Initializing the Mirror Replication Agent transaction log

Before you can initialize a transaction log, the Mirror Replication Agent instance must be running, and connectivity to the primary database must be established. See “Starting the Mirror Replication Agent” and “Setting up Mirror Replication Agent connectivity” for more information.

StepsTo initialize a Mirror Replication Agent transaction log in the primary database

  1. Log in to the Mirror Replication Agent instance with the administrator login.

  2. Use the following command to determine if a transaction log associated with this Mirror Replication Agent instance already exists in the primary database:

    ra_helpsysinfo
    

    If a transaction log does not exist, the ra_helpsysinfo command returns no information about transaction log objects. Continue this procedure to create a transaction log in the primary database.

    NoteThe ra_helpsysinfo command looks for transaction log components based on the value of the pdb_xlog_prefix configuration parameter. If the value of the pdb_xlog_prefix parameter changed after a transaction log was created, the ra_helpsysinfo command will not find the previously created transaction log objects.

    If a Mirror Replication Agent transaction log exists in the primary database, the ra_helpsysinfo command returns a list of the transaction log objects. For Mirror Replication Agent for Oracle, if replication has not been initialized, it returns the Oracle database instance name.

    If a transaction log exists for the Mirror Replication Agent instance, you do not need to complete this procedure.

  3. If you want to use a particular string for the database object name prefix of the transaction log components, use the ra_config command to set the value of the pdb_xlog_prefix parameter:

    ra_config pdb_xlog_prefix, XXX
    

    where XXX is a one- to three-character string that will be the new value of the pdb_xlog_prefix parameter, and the prefix string used in the database object names of transaction log components when the transaction log is created. The default value of the pdb_xlog_prefix parameter is ra_.

    NoteThe value of the pdb_xlog_prefix_chars parameter specifies the non-alphabetic characters that are allowed in the prefix string (the value of the pdb_xlog_prefix parameter). The primary data server may restrict the characters that can be used in database object names.

    You can also use ra_config to determine the current value of the pdb_xlog_prefix parameter:

    ra_config pdb_xlog_prefix
    

    When you invoke ra_config and specify a configuration parameter with no value, it returns the current value of that parameter.

  4. Use the pdb_init command to initialize the Mirror Replication Agent transaction log:

    pdb_init
    

    NoteWhen you invoke pdb_init, the command returns an error message if a transaction log (using the prefix string currently specified in the pdb_xlog_prefix parameter) already exists in the primary database.

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

    For Replication Agents that use a RASD, the RASD is initialized with information from the primary database.

    NoteYou can configure the Mirror Replication Agent to generate the script—but not execute it—by setting the value of the pdb_auto_run_scripts parameter to false before you invoke the ra_init command. To complete the transaction log creation, you must manually execute that script in the primary database.

If the log-creation script executes successfully, the script is stored in a file named partinit.sql in the scripts/xlog/installed directory.

If the log-creation script does not execute successfully, the primary database is not changed, and the script is stored in a file named partinit.sql in the scripts/xlog directory.

Check the primary database error log to determine why the log-creation script did not execute successfully. See Chapter 4, “Troubleshooting Mirror Replication Agent,” for more information.