Deinitializing a Replication Agent Instance

Deinitialize an instance of Replication Agent, and remove its objects from the primary database.

Prerequisites

The Replication Agent instance must be running in Admin state to remove its objects from the primary database and to deinitialize Replication Agent.

Task
  1. Log in to the Replication Agent instance with the administrator login.
  2. Verify that the Replication Agent objects exist in the primary database:
    ra_admin

    If the Replication Agent objects do not exist in the primary database, the ra_admin command returns no information about any objects. If no objects exist, you do not need to complete this procedure.

    Note: The ra_admin command looks for Replication Agent objects based on the current value of the ra_admin_instance_prefix configuration parameter. If the value of the ra_admin_instance_prefix parameter changed after the Replication Agent instance was initialized, the ra_admin command cannot find the Replication Agent objects that were previously created.

    If objects exist for this Replication Agent instance, the ra_admin command returns a list of the names of the objects. Continue this procedure to remove the objects from the primary database.

  3. 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. Disable replication for all marked procedures in the primary database:
    pdb_setrepproc all, disable
  5. 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.

    Note: Unmarking all tables at once in the primary database using pdb_setreptable all, unmark is not supported in Replication Agent for UDB. You must unmark each table individually.
  6. 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. Normally, if any objects in the primary database are marked for replication, you cannot remove the Replication Agent transaction log.

  7. Remove the Replication Agent objects:
    ra_admin deinit
    When you invoke the ra_admin command with the deinit keyword, the command returns an error message if no Replication Agent objects exist in the primary database.

    After you invoke the ra_admin command with the deinit keyword, Replication Agent generates a script that removes the objects from the primary database and deinitializes Replication Agent.

    Note: You 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 before invoking the ra_admin command. To complete the removal of the Replication Agent objects, you must set pdb_auto_run_scripts to true and re-run the ra_admin init command. This script is for informational purposes only. Executing it manually in the primary database does not deinitialize the Replication Agent instance.

If the deinitialization was successful, the script is stored in a file named partdeinit.sql file in the RAX-15_5\inst_name\scripts\xlog\installed directory.

If the deinitialization was not successful, the script is stored in a file named partdeinit.sql in the RAX-15_5\inst_name\scripts\xlog directory.

Related concepts
Replication Agent Start-Up