ra_admin

Returns the names of Replication Agent system objects; creates them in the primary database, or removes them from the primary database.

ra_admin verifies that permissions are valid for Replication Agent to obtain system data from the primary database. ra_admin also checks the condition of the primary database to determine whether archiving is turned on, and then loads the RASD with system data from the primary database.

The ra_admin command verifies that permissions are valid for Replication Agent to obtain system data from the primary database. The command also checks the condition of the primary database to determine whether archiving is turned on, and then loads the RASD with system data from the primary database.

Note: Use ra_admin and ra_locator instead of pdb_xlog, which has been deprecated.

Syntax

ra_admin [ { init | refresh | deinit[, force] } ]

Parameters

Examples

Usage

  • When you invoke ra_admin with no option, it returns the actual names (not synonyms or aliases) of all Replication Agent system objects in the primary database. If you have initialized Replication Agent, it returns the name of the component and the primary database instance name.

    When you invoke ra_admin with no option, it returns the actual names (not synonyms or aliases) of all Replication Agent system objects in the primary database. If you have initialized Replication Agent, it returns the name of the component and the primary database instance name.

    See the section for your specific primary data server in the Replication Agent Primary Database Guide for more information on Replication Agent object names.

  • If you invoke ra_admin with no option and the Replication Agent system objects do not exist in the primary database, or the RASD has not been initialized, the command returns no information.

  • If you invoke ra_admin with the init keyword, the truncation point is moved to the end of the primary database transaction log.

  • When you invoke ra_admin with the init keyword, Replication Agent:
    • Generates a SQL script that creates the Replication Agent tables and procedures in the primary database.

    • Saves the generated script in a file called partinit.sql in the RAX-15_5\inst_name\scripts\xlog directory, where inst_name is the name of the Replication Agent instance.

      Note: If the value of the pdb_auto_run_scripts configuration parameter is false, the partinit.sql script is saved but not executed. However, you cannot manually run the script. To complete initializing Replication Agent, first set pdb_auto_run_scripts to true, then re-run the ra_admin init command.
    • Executes the script to create the Replication Agent system objects in the primary database (if the value of the pdb_auto_run_scripts configuration parameter is true).

    • After the script completes successfully, moves the partinit.sql file to the RAX-15_5\inst_name\scripts\xlog\installed directory.

    • If the create script fails, it is stored in a file (partinit.sql) in the RAX-15_5\inst_name\scripts\xlog directory and the transaction log is not created. You can examine the script by viewing the partinit.sql file.

  • If you invoke ra_admin with the init keyword and the Replication Agent objects already exist in the primary database or the RASD has been initialized, ra_admin returns an error message.

  • If you invoke ra_admin with the refresh keyword, the truncation point is moved to the end of the log if Replication Agent is not already initialized. However, if Replication Agent is already initialized, the truncation point is not moved.

    Note: Use ra_admin refresh only when advised by Sybase Technical support.
  • When you invoke ra_admin with the deinit keyword, Replication Agent:
    • Generates a SQL script that deletes the tables and procedures required for the system objects in the primary database.

    • Saves the generated script in a file called partdeinit.sql in the RAX-15_5\inst_name\scripts\xlog directory, where inst_name is the name of the Replication Agent instance.

      Note: If the value of the pdb_auto_run_scripts configuration parameter is false, the partdeinit.sql script is saved but not executed automatically. You cannot manually run the script. To complete deinitializing Replication Agent, first set pdb_auto_run_scripts to true, then re-run the ra_admin deinit command.
    • Executes the script to delete the Replication Agent objects from the primary database (if the value of the pdb_auto_run_scripts configuration parameter is true).

    • After the script completes successfully, moves the partdeinit.sql file to the RAX-15_5\inst_name\scripts\xlog\installed directory.

    • If the script fails, it is stored in a file (partdeinit.sql) in the RAX-15_5\inst_name\scripts\xlog directory and the Replication Agent objects are not deleted from the primary database. You can examine the script by viewing the partdeinit.sql file.

  • When you invoke ra_admin with the deinit keyword followed by the force keyword, the partdeinit.sql script continues executing, even if errors occur. The force keyword may be useful when a previous remove operation failed and the partdeinit.sql script terminated with an error.

  • If you invoke ra_admin with the deinit keyword, and Replication Agent objects do not exist in the primary database or the RASD has not been initialized, ra_admin returns an error message.

  • If you invoke ra_admin with the deinit keyword and any objects in the primary database are still marked for replication, ra_admin returns an error message.

    You can use the pdb_setrepproc and pdb_setreptable commands to determine which stored procedures and tables in the primary database are still marked. You also can use the pdb_setrepddl command to determine if DDL is enabled.

    Even if objects are marked in the primary database, you can use ra_admin with the deinit keyword followed by the force keyword to unmark any marked objects, and then remove the transaction log objects.

  • If you invoke ra_admin with no option, the command is valid when the Replication Agent instance is in the Admin, Replicating, or Replication Down states.

  • If you invoke ra_admin with either the init or deinit keyword, the command is valid only when the Replication Agent instance is in the Admin or Replication Down state.

  • The ra_admin init command verifies that these privileges have been granted to pds_username:

    • EXECUTE_CATALOG_ROLE

    • SELECT ON V_$LOGMNR_CONTENTS

    • SELECT ON V_$LOGMNR_LOGS

    These privileges are necessary for the ra_dumptran and ra_helpop commands to function properly. These privileges are not required for replication, only for using the ra_dumptran and ra_helpop commands, which are used in debugging and troubleshooting. If these privileges have not been granted at the time you invoke ra_admin init, a warning message is returned and logged in the Replication Agent log file.

  • For more information about the Replication Agent transaction log, see the section for your specific primary data server in the Replication Agent Primary Database Guide.

Related reference
pdb_setrepcol
pdb_setrepproc
pdb_setreptable
ra_admin
ra_locator
pdb_xlog