Truncating the Replication Agent transaction log

The Replication Agents for Microsoft SQL Server, Oracle, and UDB support both automatic and manual transaction log truncation.

You can enable or disable automatic log truncation at any time, and you can truncate the Replication Agent transaction log manually at any time, with automatic log truncation either enabled or disabled.

NoteThe Replication Agent for Oracle supports transaction log truncation by controlling archive operations against the Oracle redo log and archive log files. See the Replication Agent Primary Database Guide for details.

WARNING! The Replication Agent for UDB supports primary database log truncation by deleting log files that are no longer needed for replication. This feature is disabled by default. See the Replication Agent Primary Database Guide for details.

When the Replication Agent truncates its transaction log, either automatically or on command (manually), the truncation point is determined by the most recent LTM Locator received from the primary Replication Server.

Automatic truncation

You have two options for automatic transaction log truncation:

Replication Agent truncates the transaction log based on the most recent truncation point received from the primary Replication Server. The truncation point is part of the information contained in the LTM Locator.

StepsTo enable automatic log truncation

  1. Log in to the Replication Agent instance with the administrator login.

  2. Use the ra_config command to enable automatic log truncation and specify the type of automatic truncation:

  3. If you enabled automatic log truncation based on a time interval, use ra_config to specify the time interval for automatic truncation:

    ra_config truncation_interval, N
    

    where N is the number of seconds between automatic truncations.

    NoteThe maximum truncation_interval value is 720.

See the Sybase Replication Agent Reference Manual for more information about the truncation_interval and truncation_type configuration parameters.

StepsTo disable automatic log truncation

  1. Log in to the Replication Agent instance with the administrator login.

  2. Use the ra_config command to disable automatic log truncation:

    ra_config truncation_type, command
    

NoteIf the value of the truncation_type parameter is interval, and the value of the truncation_interval parameter is 0 (zero), automatic log truncation is effectively disabled.

Manual truncation

If automatic log truncation is disabled, you must periodically truncate the Replication Agent transaction log manually.

StepsTo truncate the Replication Agent transaction log manually

  1. Log in to the Replication Agent instance with the administrator login.

  2. Use the following command to truncate the Replication Agent transaction log:

    pdb_truncate_xlog
    

    The pdb_truncate_xlog command is asynchronous; it does not return success or failure, unless an immediate error occurs.

    NoteTo determine the results of pdb_truncate_xlog, you can use the ra_statistics command, both before and after you invoke pdb_truncate_xlog, to compare the Number of transactions truncated value. Replication Agent for Oracle does not provide this statistic.

See the Sybase Replication Agent Reference Manual for more information about the pdb_truncate_xlog command.

NoteAs an alternative to the Replication Agent automatic log truncation feature, use a scheduler utility to execute the pdb_truncate_xlog command in a script.