Creating the Replication Agent instance

A single installation of the Replication Agent can support replication from multiple databases. However, one Replication Agent instance is needed for each IBM DB2 Universal Database that is to be replicated. This section describes how to prepare for the creation of an instance.

StepsTo prepare the Replication Agent instance

  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 it provides a way to record or retain the configuration information for a Replication Agent instance, allowing an instance to be removed and re-created Replication Agent instance, allowing an instance to be removed and re-created.

    The resource file template for an IBM DB2 Universal Database instance is $SYBASE/RAX-15_1/init/ibmudb.rs.

  2. Create an instance resource file.

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

    cp ibmudb.rs myra.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 IBM DB2 Universal Database, Replication Server, and RSSD connections.The resource file is self-documenting, with each parameter described. For more information, refer to the Replication Agent Administration Guide, in Chapter 2, “Setup and Configuration,” the section titled, “Creating a Replication Agent instance using resource files.”

    NoteTable 3-4 lists parameters in the order they appear in the resource file, not alphabetically.

    Table 3-4: 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)

    pds_host_name

    Machine (host) where IBM DB2 Universal Database is installed.

    NY

    pds_port_number

    Port number for IBM DB2 Universal Database.

    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

    Data source name or database alias for the primary database

    DBALIAS

    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_source_ds

    Valid name representing data server of primary IBM DB2 Universal Database.

    NY

    rs_source_db

    Valid name representing primary IBM DB2 Universal Database.

    NYudb9

    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 Replication Server’s configuration file, $SYBASE/REP-15_0 /install/<server>.cfg.

    • 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 IBM DB2 Universal Database transaction log files from the path specified by pdb_archive_path.

    USE_DEFAULT

    pdb_archive_path

    Identifies directory path where Replication Agent expects to find archived IBM DB2 Universal Database transaction log files.

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

    start_instance

    Start the instance that was created.

    yes

    initialize_instance

    Initialize the Replication Agent instance.

    yes

  3. Set the IBM DB2 Universal Database environment variables by sourcing either db2chsrc or db2profile as described in “Setting IBM DB2 Universal Database environment variables”.

  4. Create and execute the new instance resource file:

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

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

      Here, myra.rs is the path name of the resource file.

    2. Validation results are returned as one of the following:

      • Response-file processing completed

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

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

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

      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.

    4. Creation results are returned as one of the following:

      • Response-file processing completed

      • Response-file processing completed with errors

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

  5. If, in your resource file, you set start_instance to yes, skip this step, and continue with the next section. If your resource file did not configure start_instance to yes, change to the instance directory and run Replication Agent in the background:

     cd $SYBASE/RAX-15_1/myra
    

    Execute the RUN file in the background, for example:

    ./RUN_myra &
    

Your Replication Agent for UDB is now running.