Control Transaction Log Size

Control the size of transaction logs to prevent the log files from growing indefinitely.

You could use the SQL Anywhere dbbackup utility, with the -xo flag. The -xo flag deletes the current transaction log file, once it has been backed up successfully, and creates a new one. See SQL Anywhere® Server – Database Administration for information.

You could also use a variant of the SQL Anywhere BACKUP DATABASE command. See the SQL Anywhere Server – SQL Reference for BACKUP DATABASE command options. This example performs daily backups automatically from within the database server:

CREATE EVENT NightlyBackup
SCHEDULE
START TIME '23:00' EVERY 24 HOURS
HANDLER
BEGIN
   DECLARE dest LONG VARCHAR;
   DECLARE day_name CHAR(20);
   
   SET day_name = DATENAME( WEEKDAY, CURRENT DATE );
   SET dest = 'd:\\backups\\' || day_name;
           BACKUP DATABASE DIRECTORY dest
   TRANSACTION LOG RENAME;
END;