Truncating the 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.

NoteDepending on the type of database and the Replication Agent configuration, Replication Agent truncates either the database online logs or archive logs. Sybase recommends that you configure Replication Agent to truncate the database archive logs. 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.

StepsEnabling 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:

    • Use the following commands to enable automatic log truncation at a specified time interval:

      ra_config truncation_type, interval
      
      ra_config truncation_interval, N
      

      Here, N is the number of minutes between automatic truncations.

      NoteThe maximum truncation_interval value is 720.

    • Use the following command to enable automatic log truncation whenever the Replication Agent receives a new LTM Locator value from the primary Replication Server:

      ra_config truncation_type, locator_update
      

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

StepsDisabling 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.

StepsTruncating 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.

See the 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.