Deinitializing Replication Agent

The Replication Agent instance must be running in Admin state to remove its objects from the primary database and to deinitialize Replication Agent. See “Starting the Replication Agent” for more information.

StepsRemoving Replication Agent objects 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 the Replication Agent objects exist in the primary database:

    pdb_xlog
    

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

    NoteThe pdb_xlog command looks for Replication Agent objects based on the current value of the pdb_xlog_prefix configuration parameter. If the value of the pdb_xlog_prefix parameter changed after the Replication Agent instance was initialized, the pdb_xlog command cannot find the Replication Agent objects that were previously created.

    If objects exist for this Replication Agent instance, the pdb_xlog command returns a list of the names of the objects. Continue this procedure to remove the objects 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.

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

    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 Replication Agent objects:

    pdb_xlog remove
    

    NoteWhen you invoke the pdb_xlog command with the remove keyword, the command returns an error message if no Replication Agent objects exist in the primary database.

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

    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 before invoking the pdb_xlog command. To complete the removal of the Replication Agent objects, you must set pdb_auto_run_scripts to true and rerun the pdb_xlog init command.

If the log removal script executes successfully, the script is stored in a file named partdeinit.sql file in the RAX-15_2\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 RAX-15_2\inst_name\scripts\xlog directory.