The Mirror Replication Agent instance must be running in Admin state to remove the transaction log. See “Starting the Mirror Replication Agent” for more information.
To remove the Mirror Replication Agent transaction log from
the primary database
Log in to the Mirror Replication Agent instance with the administrator login.
Use the ra_helpsysinfo command to verify that a transaction log associated with this Mirror Replication Agent instance exists in the primary database:
ra_helpsysinfo
If a transaction log does not exist for this Mirror Replication Agent instance, the ra_helpsysinfo command returns no information about transaction log objects. If no transaction log exists, you do not need to complete this procedure.
The ra_helpsysinfo 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 Mirror Replication Agent instance,
the ra_helpsysinfo command will not
find the previously created transaction log.
If a transaction log exists for this Mirror Replication Agent instance, the ra_helpsysinfo 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.
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, Mirror Replication Agent disables replication for all marked tables in the primary database.
Use the pdb_setrepproc command to disable replication for all marked procedures in the primary database:
pdb_setrepproc all, disable
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, Mirror 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
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, Mirror 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
Usually, if any objects in the primary database are
marked for replication, you cannot remove the Mirror Replication Agent transaction log.
Use the ra_deinit command to remove the Mirror Replication Agent transaction log:
ra_deinit
When you invoke the ra_deinit command,
the command returns an error message if no transaction log exists
in the primary database.
After you invoke the ra_deinit command, Mirror Replication Agent generates a script that, when executed, removes the transaction log base objects from the primary database.
If the log removal script executes successfully, the script is stored in a file named partdeinit.sql in the MA-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 partdeinit.sql in the MA-15_0\inst_name\scripts\xlog directory.