Creating the Mirror Replication Agent instance

A single installation of the Mirror Replication Agent can support replication from multiple databases, however, one Mirror Replication Agent instance is needed for each Oracle database that is to be replicated.

StepsPreparing the Mirror Replication Agent instance

  1. Obtain the Oracle JDBC driver from Oracle and update the CLASSPATH environment variable.

    To find the JDBC connection that communicates with the primary Oracle instance, locate the JDBC driver that was available when the Oracle release was originally created, usually found at:

    $ORACLE_HOME/jdbc/lib/ojdbc15.jar
    

    Mirror Replication Agent may require a newer version of the JDBC driver than the version that is included in the Oracle installation. You can obtain the newer versionhttp://technet.oracle.com/software/tech/java/sqlj_jdbc/content.html.

  2. Add the JDBC driver to the CLASSPATH environment variable. For example, you can append the existing CLASSPATH to the new JDBC driver and add the following command to the .login script of a UNIX and Linux user:

    setenv CLASSPATH /path_name/ojdbc15.jar:$CLASSPATH
    

    For a Windows user, add the following to the CLASSPATH environment variable:

    set CLASSPATH=path_name\jdbc\lib\ojdbc15.jar;
    %CLASSPATH%
    
  3. Record the location of the tnsnames.ora file and record the connection name from that file for the Mirror Replication Agent to use to connect to the Oracle primary database. You can find these values from any machine where an Oracle SQLPLUS session can be used to connect to the desired Oracle instance. The ORACLE_SID is from the environment variable, $ORACLE_SID.

    Obtain host and port information from the file called tnsnames.ora, available at $ORACLE_HOME/network/admin.

    Record the following:

  4. (Optional) If your operating system has a Java 6.0.x-compatible JRE or JDK installed, you can use the Oracle iSQL (the browser-based interface to SQL*PLUS) demo items to connect to Oracle using the JDBC driver and to verify the connection information.

    To perform this validation, see “Verifying a JDBC Client Installation” in the Oracle JDBC Developer's Guide and Reference Guide.

  5. Obtain a local copy of the Oracle timezone file, so Mirror Replication Agent can correctly process the Oracle timestamp with timezone datatype.

    NoteThis step is required only if the Mirror Replication Agent is on a machine (host) other than the Oracle host and does not have access to the Oracle timezone file.

    There are two timezone files under the Oracle installation directory:

    The Oracle instance uses the timezone file from the ORA_TZFILE environment variable. If ORA_TZFILE is not set, use the default timezone file.

    Determine which timezone file is used by the primary Oracle instance and make a copy of that file available on the machine hosting the Mirror Replication Agent.

    NoteThese files are Oracle version- and platform-dependent. You cannot use a timezone file from a little-endian platform on a big-endian platform, nor can you use a timezone file from a version of Oracle that is different than the version of the primary Oracle.

  6. Locate the Mirror Replication Agent for Oracle resource file template.

    The majority of configuration values required to create and initialize a Mirror Replication Agent can be recorded and stored in a resource file. Using a resource file provides a means to record or retain the configuration information for a Mirror Replication Agent instance, allowing an instance to be removed and re-created.The resource file template (oracle.rs) is in the Mirror Replication Agent directory $SYBASE/MA-15_2/init.

  7. Create an instance resource file:

    Copy the resource file template $SYBASE/MA-15_2/init/oracle.rs to another file that contains the configuration information for a new instance, for example:

    cp oracle.rs myma.rs
    

    Change the values assigned to properties in the resource file so they match the values required for your environment. The majority of these values are tnsname location, user, and password information for the Oracle, Replication Server, and RSSD connections.The resource file is self-documenting, with each parameter described. See the Mirror Activator Administration Guide.

    NoteFor a complete list of configuration parameters, see the Mirror Replication Agent Reference Manual.

    Table 2-2: Resource file parameters

    Parameter

    Description

    Example values

    instance_name

    Any valid name.

    myma

    admin_port

    Port number that Mirror Replication Agent uses.

    9030 (if in use, select a different port number)

    pds_tns_connection

    Connection name found in the tnsnames.ora file which identifies the connection information for the primary database.

    NoteTo be used with pds_tns_filename, only if you have not set pds_host_name and pds_port_number.

    ORA102.JDOE_HOST.COM

    pds_tns_filename

    File name identifying the Oracle tnsnames.ora file to be used to identify the connection information for the primary database.

    NoteTo be used with pds_tns_connection, only if you have not set pds_host_name and pds_port_number.

    A valid Oracle tnsnames.ora file. For example:

    /opt/oracle/network/admin/ tnsnames.ora

    pds_username

    User ID that Mirror Replication Agent uses to access primary data server.

    RA_USER

    pds_password

    Password for pds_username.

    sybase

    create_pds_username

    Specifies whether or not the ma_admin utility, invoked without the -r option, should create the Mirror Replication Agent primary database user login if the login does not already exist in the primary data server. For information about the ma_admin utility -r option, see the Mirror Activator Administration Guide.

    yes

    rs_host_name

    Machine where Replication Server is installed.

    jdoe_host1

    rs_port_number

    Port where Replication Server is installed.

    11752

    rs_username

    Replication Server user with CONNECT SOURCE and CREATE OBJECT capabilities.

    SAMPLE_RS_ra

    rs_password

    Password for rs_username.

    SAMPLE_RS_ra_ps

    rs_charset

    Character set that Replication Server is using.

    NoteThe value defined for the rs_charset configuration parameter must match the RS_charset value in the Replication Server configuration file, $SYBASE/REP-15_2 /install /<server>.cfg.

    • Windows: cp850

    • UNIX: iso_1

    rs_source_ds

    Valid name representing data server of Oracle primary database.

    NY

    rs_source_db

    Valid name representing Oracle primary database.

    NYora92

    rssd_host_name

    Machine where RSSD resides.

    jdoe_host1

    rssd_port_number

    Port number where RSSD resides.

    11751

    rssd_database_name

    Database name for RSSD.

    SAMPLE_RS_ERSSD

    rssd_username

    Valid user for RSSD.

    SAMPLE_RS_RSSD_maint

    rssd_password

    Password for rssd_username.

    SAMPLE_RS_RSSD_maint_ps

    ddl_username

    Name of the user who will apply DDL at the target database.

    ddl_user

    ddl_password

    Password for ddl_username.

    password (created previously)

    pdb_timezone_file

    Path to the pdb_timezone_file directory that contains the archive redo log files.

    /software/oracle/Ora10g /oracore/zoneinfo /timezone.dat

    start_instance

    Start the instance that was created.

    yes

    initialize_instance

    Initialize the Mirror Replication Agent instance.

    NoteSet the initialize_instance parameter to yes (the default is no) to initialize the Mirror Replication Agent instance. If you retain the default value of no, manually issue the ra_devicepath command after initialization to set the correct mirror path.

    yes

    pdb_include_archives

    Enables or disables the use of Oracle archive log files.

    USE_DEFAULT

    pdb_archive_path

    Identifies directory path where Mirror Replication Agent expects to find archived Oracle redo log files.

    A valid directory path on the machine hosting Mirror Replication Agent that points to a location where Oracle puts the archived redo log files

  8. Create and execute the new instance resource file:

    NoteBe sure your CLASSPATH environment variable points to the correct Oracle JDBC driver before proceeding.

    1. Validate the settings in the resource file using the -vr parameter, for example:

      $SYBASE/MA-15_2/bin/ma_admin.sh -vr myma.rs
      

      Here, myma.rs is the path and name of the resource file. Validation results are returned as one of the following:

      • Response-file processing completed

      • Response-file processing completed with errors

      If any validation fails, the ma_admin utility returns an error message and information about the failure. You can repeat the validation process as many times as necessary until it executes without error. No entities are changed or created.

    2. After the resource file has been validated, allow the ma_admin utility to create and configure the Mirror Replication Agent instance, using the –r parameter, for example:

      $SYBASE/MA-15_2/bin/ma_admin.sh -r myma.rs
      

      Here, myma.rs is the path and name of the resource file.

      NoteIf, in your response file, you set start_instance to yes, your instance is also running. If you set initialize_instance to yes, your instance is also initialized.

    3. Results are returned as either:

      • Response-file processing completed

      • Response-file processing completed with errors

      See the Mirror Activator Administration Guide.

  9. NoteIf in your resource file you set start_instance to yes and the log indicates that the Mirror Replication Agent instance was started, skip this step, and continue with the next section.

    Change to the instance directory and run Mirror Replication Agent in the background:

     cd $SYBASE/MA-15_2/myma
    

    Execute the RUN file in the background, for example:

    ./RUN_myma &
    

    Your Mirror Replication Agent for Oracle is now running.