Initializing Mirror Replication Agent

Mirror Replication Agent uses the native transaction log maintained by the primary database to obtain transactions. To support replication, Mirror Replication Agent creates some objects in the primary database.

NoteBefore you initialize a Mirror Replication Agent, the primary database must be quiesced. The procedure for initializing Mirror Replication Agent includes that quiesce.

Specifying the object name prefix

Before you create the Mirror Replication Agent objects, you can specify the object name prefix string to be used to name the objects. You can set this prefix string to avoid conflicts with the names of existing database objects in your primary database.

The value of the pdb_xlog_prefix parameter is the prefix string used in all Mirror Replication Agent object names. Use the ra_config command to change the value of the pdb_xlog_prefix parameter.

NoteMirror Replication Agent uses the value of pdb_xlog_prefix to find its objects in the primary database. If you change the value of pdb_xlog_prefix after you initialize Mirror Replication Agent, Mirror Replication Agent is unable to find the objects that use the old prefix.

Mirror Replication Agent requires you to perform specific setup tasks at the primary database before you can initialize Mirror Replication Agent. See the Mirror Replication Agent Primary Database Guide to verify that the required setup tasks have been performed for your primary database.

StepsInitializing a Mirror Replication Agent

  1. Log in to the Mirror Replication Agent administration port.

  2. To define a prefix that uniquely identifies the Mirror Replication Agent transaction log you are creating, use the following command:

    ra_config pdb_xlog_prefix, string
    

    Here, string is a character string of one to three characters that is used as a prefix for all names of the Mirror Replication Agent objects created in the primary database.

    NoteThe default value of the pdb_xlog_prefix parameter is ra_. Unless this string poses a conflict with existing database object names in your primary database, you should use the default value.

  3. To initialize the Mirror Replication Agent, use the following command:

    pdb_init
    

    When you invoke the pdb_init command, Mirror Replication Agent does the following:

    • Checks the primary database for compatible settings.

    • Generates a SQL script that is run in the primary database. This script creates the Mirror Replication Agent objects in the primary database.

    NoteMirror Replication Agent must be initialized before any objects can be marked for replication in the primary database.

  4. To verify the correct initialization for the primary database, invoke the pdb_init command with the move_truncpt keyword, which sets the truncation point to the end of the primary database transaction log:

    pdb_init move_truncpt
    go
    

    A message should indicate that the procedure was successful.

  5. Quiesce the primary database. See “Quiesce the primary database” for details.

  6. The ra_init command initializes the Mirror Replication Agent system database by reading schema information and transaction log location information from the primary database. If this is a production setup, this step should coincide with creating the dump, copy, or data that is used to materialize the standby database.

    To initialize the Mirror Replication Agent to read schema and transaction log location information from the primary database, issue the ra_init command:

    ra_init
    
    go
    

    A message appears indicting that the procedure was successful.

    The ra_init command also causes pdb_automark_tables settings to take effect.

    NoteThe ra_init command no longer causes pdb_auto_create_repdefs settings to take effect. To create replication definitions, execute rs_create_repdef all after ra_init.

  7. Initialize the Mirror Replication Agent instance:

    ra_init
    
  8. Release the quiesce hold on the primary database:

  9. To verify that the Mirror Replication Agent was initialized and that its objects were created in the primary database, use the following command:

    ra_helpsysinfo
    

    When you invoke the ra_helpsysinfo command, Mirror Replication Agent returns a list of the transaction log base objects in the primary database if initialization completed successfully. If no information is returned, the transaction log does not exist in the primary database.

When the Mirror Replication Agent is initialized and both primary database and Replication Server connections are defined correctly, you can put the Mirror Replication Agent instance in Replicating state. See “Starting Mirror Replication Agent” for more information about putting the Mirror Replication Agent in Replicating state.