Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.

SAP Sybase SQL Anywhere 16.0 » SQL Anywhere Server - Database Administration » High availability and read-only scale-out systems » Database mirroring » Setting up a database mirroring system


Transaction log file management in a database mirroring system

When a partner server starts, it examines all the transaction log files in the same directory as the current transaction log file and determines which ones must be applied. The database server then applies the operations in these transaction logs to the database before determining whether to act as the primary or mirror server. You can store the transaction log files and the database file in the same directory. However, this directory should not contain other files because it can cause delays in starting the database.

The server that takes on the primary server role must have a transaction log with the same starting offset as the current transaction log on the mirror server, as well as any subsequent transaction log files up to the current transaction log file for the primary server.

Once a server takes on the mirror server role, it starts receiving transaction log pages from the primary server. When a transaction log rename occurs on the primary, the rename is also performed on the mirror. The mirror then writes new transaction log pages to a new file with the name specified for the transaction log.

Transaction log files can be deleted periodically on the primary. Each time a transaction log file is renamed, the mirror is notified about which transaction log file is the oldest surviving file on the primary. Any transaction log files older than this are deleted on the mirror.

You cannot truncate the current transaction log on the primary when you are using database mirroring because this may result in lost transactions. You can rename the transaction log as often as necessary. To remove old transaction logs from the primary, use a scheduled event to delete them once you are certain that they are no longer needed. For example, you can create an event that runs each day and renames the transaction log. This event could also delete copies of the transaction log that are more than a week old.

 See also