Create 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 to be replicated. This section describes how to prepare for an instance creation.

StepsTo prepare the Mirror Replication Agent instance

  1. Obtain the Oracle JDBC driver, which must be acquired from Oracle, and update the CLASSPATH 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/ojdbc14.jar.

    Mirror Replication Agent may require a newer version of the JDBC driver that was installed with Oracle. See the current version from Oraclehttp://technet.oracle.com/software/tech/java/sqlj_jdbc/content.html.

    Refer to the release bulletin or EBF letter of your Mirror Replication Agent to obtain the correct version of the JDBC driver.

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

    setenv CLASSPATH /path_name/ojdbc14.jar:$CLASSPATH 
    

    Additional information about the JDBC driver requirements and setup can be found in the Mirror Replication Agent Installation Guide, Chapter 2, Setup and Configuration, in the section titled, “Setting up Mirror Replication Agent connectivity.”

  3. Record the Oracle connectivity details for the primary Oracle 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. You can obtain host and port information from the file called $ORACLE_HOME/network/admin/tnsnames.ora.

    Record the following:

  4. (Optional) If your operating system has a Java 1.4.x compatible JRE or JDK installed, you can use Oracle isql demo items to verify Java 1.4.x, and to connect to Oracle using the JDBC driver and the connection information.To perform this validation, refer to the Oracle JDBC Developer's Guide and Reference Guide, in the section titled, “Verifying a JDBC Client Installation.”

  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 only required if the Mirror Replication Agent is on a different machine (host) 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 platform dependent. You cannot use a timezone file from a little endian platform on a big endian platform, or vice versa.

  6. Determine the default settings you want.

    By default, Mirror Replication Agent is configured to mark every user table in the primary Oracle database for replication, and to create a replication definition for every table marked.Although these settings may be reasonable for production environments, they may not be wanted in a test or proof of concept environment, where only a subset of tables are being replicated. If you do not want automatic table marking or replication definition generation options, change the settings of two Mirror Replication Agent configuration parameters: pdb_automark_tables and pdb_auto_create_repdefs.

    For more information about these configuration parameters, refer to the Mirror Replication Agent Reference Manual.

  7. Locate the sample resource file.

    The majority of configuration values required to create and initialize a Mirror Replication Agent can be recorded and stored in a resource file. Using it 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.A sample resource file can be found in the Mirror Replication Agent directory $SYBASE/MA-15_0/init/oracle.rs.

  8. Create an instance resource file.

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

    cp oracle.rs myma.rs
    

    Using a text editor, 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 host, port, user, and password information for the Oracle, Replication Server, and RSSD connections.The resource file is self-documenting, with each parameter described. For more information, refer to the Mirror Replication Agent Administration Guide, in Chapter 2, “Setup and Configuration,” the section titled, “Creating a Mirror Replication instance using resource files.”

    Table 2-1: Resource file parameters

    Parameter

    Description

    Example values

    instance name

    Any valid name

    my_ma

    admin_port

    Port number that Mirror Replication Agent will use

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

    ddl_username

    User name that can execute DDL commands

    DDLuser

    ddl_password

    Password created for ddl_ username.

    password (created previously)

    initialize_instance

    Initialize the Mirror Replication Agent instance

    yes

    pdb_archive_path

    Identifies directory path where 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

    pdb_archive_remove

    Enables or disables the removal of archived Oracle redo log files from the path specified by pdb_archive_path

    USE_DEFAULT

    pdb_include_archives

    Enables or disables the use of Oracle archive log files

    USE_DEFAULT

    pdb_timezone_file

    Path to the pdb_timezone-file directory that contains the archive redo log files

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

    pds_host_name

    Machine (host) where Oracle is installed

    crane

    pds_port_number

    Port number for Oracle

    1521

    pds_database_name

    $ORACLE_SID

    testoral

    pds_username

    Same as created previously in step 1, page 6

    MA_USER

    pds_password

    Password for pds_username

    sybase

    pds_sa_username

    System admin name

    system

    pds_sa_password

    System admin name password

    manager

    ra_devicepath_1

    Primary database log mirror location information

    ra_devicepath_1= logA, /dev/pubs2/logA.dat, or leave commented if not using mirrored log

    rs_charset

    Character set that Replication Server is using

    NoteThe rs_charset value must be set to match Replication Server’s character set.

    iso_1

    rs_host_name

    Machine where Replication Server is installed

    crane

    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_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

    crane

    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

    start_instance

    Start the instance that was created

    yes

    WARNING! The rs_source_ds and the rs_source_db values must match the “pds.pdb” values of your Replication Server primary connection name.

  9. Create and execute the new instance resource file:

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

    1. Using the Mirror Replication Agent ma_admin utility, validate the settings in the resource file using the –vr parameter, for example:

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

      where myma.rs is the path name of the resource file.

    2. Validation results are returned as either:

      • Response_file processing completed, or

      • 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 because of this process.

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

      $SYBASE/MA-15_0/bin/ma_admin.sh -r myma.rs 
      
    4. Validation results are returned as either:

      • Response_file processing completed, or

      • Response_file processing completed with errors.

      For more information about the resource file or its use, refer to the Mirror Replication Agent Administration Guide, Chapter 2, “Setup and Configuration,” in the section titled, “Creating a Mirror Replication instance using resource files.”

  10. Change to the $SYBASE directory and run the Mirror Replication Agent:

     $SYBASE/MA-15_0/myma
    

    Execute the RUN file, for example:

    ./RUN_myma &
    

    Your Mirror Replication Agent for Oracle is now running.