Creating the Replication Agent Instance

Prepare and create a Replication Agent instance for replication of each DB2 UDB database.

A single installation of the Replication Agent can support replication from multiple databases. However, one Replication Agent instance is needed for each DB2 UDB database that is to be replicated.
Note: To replicate from multiple databases, using one Replication Agent instance for each database, you must create a separate DB2 UDB user for each primary database. You cannot use the same user for multiple Replication Agents.
  1. Locate the resource file template.
    The majority of configuration values required to create and initialize a Replication Agent can be recorded and stored in a resource file. Using a resource file provides a way to record or retain the configuration information for a Replication Agent instance, allowing an instance to be removed and re-created.
    The resource file template for a DB2 UDB instance is $SYBASE/RAX-15_5/init/ibmudb.rs (UNIX or Linux) or %SYBASE%\RAX-15_5\init\ibmudb.rs (Windows).
    The resource file template for a DB2 UDB instance is $SYBASE/RAX-15_2/init/ibmudb.rs (UNIX or Linux) or %SYBASE%\RAX-15_2\init\ibmudb.rs (Windows).
  2. Create an instance resource file:
    • Copy the resource file template to another file that contains the configuration information for a new instance, for example, myra.rs.
    • Change the values that are assigned to properties in the resource file to match the values required for your environment. Most of these values are host, port, user, and password information for the DB2 UDB, Replication Server, and RSSD connections.
      • Set the value of rs_source_ds to the value you chose for pds in previous procedures.
      • Set the value of rs_source_db to the value you chose for pdb in previous procedures.
    • When you create a Replication Agent instance with a resource file:
      • The asa_password configuration parameter value cannot contain single quotes, double quotes, or a semicolon.
      • The pds_username and pds_password configuration parameter values cannot contain single or double quotes if the create_pds_username parameter is set to yes.
    The resource file is self-documenting, with each parameter described. See the Replication Agent Administration Guide.
    Note: This table lists parameters in the order they appear in the resource file, not alphabetically.
    Resource File Parameters

    Parameter

    Description

    Example Values

    instance name

    Any valid name.

    myra

    admin_port

    Port number that Replication Agent uses.

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

    ltm_admin_user

    User name for administering the Replication Agent instance.

    sa

    ltm_admin_pw

    Password for the user administering the Replication Agent instance.

    The default password policy is that the password must be between 6 and 255 characters. For example: sa_pass

    pds_host_name

    Machine (host) where DB2 UDB is installed.

    NY

    pds_port_number

    Port number for DB2 UDB.

    Make sure you know which port your DB2 UDB instance is using. You can find this information in the /etc/services file.

    50007

    pds_database_name

    Name of the primary database.

    NYudb9

    pds_username

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

    ra_user

    pds_password

    Password for pds_username.

    sybase

    pds_datasource_name

    Datasource name or database alias for the primary database.

    By default, the alias may be the same name as the database name.

    NYudb9

    rs_host_name

    Machine where Replication Server is installed.

    jdoe_host1

    rs_port_number

    Port number where Replication Server is installed.

    11752

    rs_username

    Replication Server user with connect source and create object permissions.

    SAMPLE_RS_ra

    rs_password

    Password for rs_username.

    SAMPLE_RS_ra_ps

    rs_source_ds

    Valid name representing data server of the primary DB2 UDB database.
    Note: If you use direct load materialization, add an entry with this name in the interfaces file.

    pds

    rs_source_db

    Valid name representing the primary DB2 UDB database.

    pdb

    rs_charset

    Character set that Replication Server is using.

    The value defined for the rs_charset configuration parameter must match the RS_charset value in the Replication Server configuration file, $SYBASE/REP-15_5 /install/<server>.cfg (UNIX or Linux) or %SYBASE%\REP-15_5 \install\<server>.cfg (Windows).

    • Windows: cp850

    • UNIX: iso_1

    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

    pdb_archive_remove

    Enables or disables the removal of archived DB2 UDB transaction log files from the path specified by pdb_archive_path.

    USE_DEFAULT

    pdb_archive_path

    Directory path where Replication Agent expects to find archived DB2 UDB transaction log files.

    A valid directory path on the machine hosting Replication Agent that points to a location where DB2 UDB puts the archived transaction log files

    start_instance

    Start the instance that was created.

    USE_DEFAULT

    initialize_instance

    Initialize the Replication Agent instance.

    USE_DEFAULT

    Warning!   The rs_source_ds and the rs_source_db values must match the pds.pdb values of your Replication Server primary connection name.
  3. Set the DB2 UDB environment variables by sourcing db2cshrc, db2profile, or your customized versions of the scripts.
  4. Set the environment variables by sourcing the SYBASE.csh file (UNIX or Linux) or by executing the SYBASE.bat file (Windows).
  5. Create and execute the new instance resource file:
    1. Validate the settings in the resource file using the -vr parameter.
      • On Windows:

        %SYBASE%\RAX-15_5\bin\ra_admin.bat -vr myra.rs
        %SYBASE%\RAX-15_2\bin\ra_admin.bat -vr myra.rs
      • On UNIX or Linux:

        $SYBASE/RAX-15_5/bin/ra_admin.sh -vr myra.rs 
        $SYBASE/RAX-15_2/bin/ra_admin.sh -vr myra.rs 

      where myra.rs is the path and name of the resource file.

      Validation results are returned as either:
      • Response-file processing completed, or,

      • Response-file processing completed with errors

      If any validation fails, the ra_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 ra_admin utility to create and configure the Replication Agent instance, using the -r parameter.
      • On Windows:

        %SYBASE%\RAX-15_5\bin\ra_admin.bat -r myra.rs
        %SYBASE%\RAX-15_2\bin\ra_admin.bat -r myra.rs
      • On UNIX or Linux:

        $SYBASE/RAX-15_5/bin/ra_admin.sh -r myra.rs 
        $SYBASE/RAX-15_2/bin/ra_admin.sh -r myra.rs 

      where myra.rs is the path and name of the resource file.

      Note: If start_instance is yes in your response file, your instance is also running. If initialize_instance is yes, your instance is also initialized.
    3. Creation results are returned as either:
      • Response-file processing completed

        or,

      • Response-file processing completed with errors

      See the Replication Agent Administration Guide.

  6. If start_instance is yes in your response file, skip this step, and continue with the next section. If start_instance is false in your response file, change to the instance directory and run Replication Agent in the background.
    • On Windows:

       cd %SYBASE%\RAX-15_5\myra
    • On UNIX or Linux:

       cd $SYBASE/RAX-15_5/myra

    Execute the RUN_myra file in the background.

Your Replication Agent for DB2 UDB is now running.