Removing the Replication Agent transaction log

The Replication Agent instance must be running in Admin state to remove the transaction log. See “Starting the Sybase Replication Agent” for more information.

StepsTo remove the Replication Agent transaction log from the primary database

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

  2. Use the pdb_xlog command to verify that a transaction log associated with this Replication Agent instance exists in the primary database:

    pdb_xlog
    

    If a transaction log does not exist for this Replication Agent instance, the pdb_xlog command returns no information about transaction log objects. If no transaction log exists, you do not need to complete this procedure.

    NoteThe pdb_xlog command looks for transaction log components based on the current value of the pdb_xlog_prefix configuration parameter. If the value of the pdb_xlog_prefix parameter changed after a transaction log was created for a Replication Agent instance, the pdb_xlog command will not find the previously created transaction log.

    If a transaction log exists for this Replication Agent instance, the pdb_xlog command returns a list of the names of the transaction log database objects. Continue this procedure to remove the transaction log from the primary database.

  3. Use the pdb_setreptable command to disable replication for all marked tables in the primary database:

    pdb_setreptable all, disable
    

    When you invoke the pdb_setreptable command with the all and disable keywords, Replication Agent disables replication for all marked tables in the primary database.

  4. Use the pdb_setrepproc command to disable replication for all marked procedures in the primary database:

    pdb_setrepproc all, disable
    
  5. Use the pdb_setreptable command to unmark all marked tables in the primary database:

    pdb_setreptable all, unmark
    

    When you invoke the pdb_setreptable command with the all and unmark keywords, Replication Agent removes replication marking from all marked tables in the primary database.

    If there are pending transactions for any trigger-based table that you attempt to unmark, pdb_setreptable returns an error message. You can force an unmark, regardless of pending transactions or the table’s enable status, by following the unmark keyword with the force keyword:

    pdb_setreptable all, unmark, force
    
  6. Use the pdb_setrepproc command to unmark all marked procedures in the primary database:

    pdb_setrepproc all, unmark
    

    When you invoke the pdb_setrepproc command with the all and unmark keywords, Replication Agent removes replication marking from all marked procedures in the primary database.

    If there are pending transactions for any trigger-based procedure that you attempt to unmark, pdb_setrepproc returns an error message. You can force an unmark, regardless of pending transactions or the procedure’s enable status, by following the unmark keyword with the force keyword:

    pdb_setrepproc all, unmark, force
    

    NoteNormally, if any objects in the primary database are marked for replication, you cannot remove the Replication Agent transaction log.

  7. Use the pdb_xlog command to remove the Replication Agent transaction log:

    pdb_xlog remove
    

    NoteWhen you invoke the pdb_xlog command with the remove keyword, the command returns an error message if no transaction log exists in the primary database.

    After you invoke the pdb_xlog command with the remove keyword, Replication Agent generates a script that, when executed, removes the transaction log base objects from the primary database.

    NoteYou can configure Replication Agent to simply build the script, but not execute it, by setting the value of the pdb_auto_run_scripts parameter to false prior to invoking the pdb_xlog command. To complete the transaction log removal process when there is no RASD involved, you have to manually execute the script.

If the log removal script executes successfully, the script is stored in a file named remove.sql file in the RAX-15_0\inst_name\scripts\xlog\installed directory.

If the log removal script does not execute successfully, the script is stored in a file named remove.sql in the RAX-15_0\inst_name\scripts\xlog directory.