The transaction log file

The transaction log file contains information that allows Sybase IQ to recover from a system failure. The transaction log is also required for auditing. The default file name extension for this file is .log.

To move or rename the transaction log file, use the Transaction Log utility (dblog). See “Transaction Log utility (dblog)”in Chapter 4, “Database Administration Utilities,” in the Utility Guide.

WARNING! The Sybase IQ transaction log file is different from most relational database transaction log files. If for some reason you lose your database files, then you lose your database (unless it is the log file that is lost). However, if you have an appropriate backup, then you can reload the database.

Truncating the transaction log

Sybase IQ records in the transaction log the information necessary to recover from a system failure. Although the information logged is small for each committed transaction, the transaction log continues to grow in size. In systems with a high number of transactions that change data, over a period of time the log can grow to be very large.

When to truncate the log is really up to the DBA responsible for supporting the Sybase IQ systems, and depends on the growth profile of the log file and the operational procedures at the site.

Table 4-5 shows methods for truncating transaction logs in Sybase IQ.

Table 4-5: Truncating transaction logs

If your database is …

Use this method …

For details, see …

Stopped

“The –m switch, which causes the transaction log to be truncated after each checkpoint for all databases

“Truncating the transaction log of a stopped database”

Running

The dbbackup command line utility with the -xo switch or the -r switch

Backup utility (dbbackup) in Utility Guide.

Truncating the transaction log of a stopped database

Use the –m server start-up switch to truncate the transaction log of a database. Note that leaving the –m server start-up switch permanently set is not recommended. This switch should only be used to start Sybase IQ for a transaction log truncation. How this is done is up to the DBA, but the following procedure provides a suggestion.

StepsTruncating the transaction log of a stopped database

  1. Create a copy of the server switches .cfg file with a name identifying the file as the log truncation configuration setting and edit this copy of the file to add the –m switch.

  2. Start Sybase IQ with the configuration file containing the –m option. Note that no user access or transactions should be allowed at this time.

  3. Shut down Sybase IQ and restart using the configuration file without the –m option set.