Multi-Path Replication from Oracle to Adaptive Server

Set up a Multi-Path Replication system with two primary and replicate connections for end-to-end replication from an Oracle primary to an Adaptive Server replicate.

Prerequisites
This scenario assumes you have already installed and configured:
Task
  1. At the primary Oracle database, select or create two tables that you want to replicate through two replication paths.
  2. Use rs_init to add the replicate database to the replication system.
  3. Create a default connection to the primary Oracle database:
    create connection to pds.pdb
    set error class rs_sqlserver_error_class
    set function string class rs_oracle_function_class
    set username muser
    set password mpwd
    with log transfer on,
    dsi_suspended
    go
    where:
    • pds is the value of the rs_source_ds parameter specified in Replication Agent.

    • pdb is the value of rs_source_db specified in Replication Agent.

    • muser is the maintenance user for the primary Oracle database.

    • mpwd is the maintenance user password.

  4. Create an alternate connection to the primary Oracle database:
    create alternate connection to pds.pdb
    named pds.conn2
    set error class rs_sqlserver_error_class
    set function string class rs_oracle_function_class
    set username muser
    set password mpwd
    with primary only
    go
  5. Create a connection to the replicate Adaptive Server database:
    create connection to rds.rdb
    set error class rs_sqlserver_error_class
    set function string class rs_sqlserver_function_class
    set username muser
    set password mpwd
    go
    where:
    • rds is the name of the replicate Adaptive Server data server.

    • rdb is the replicate Adaptive Server database.

    • muser is the maintenance user for the replicate Adaptive Server database.

    • mpwd is the maintenance user password.

  6. Create an alternate connection to the replicate Adaptive Server database:
    create alternate connection to rds.rdb
    named rds.conn2
    set error class rs_sqlserver_error_class
    set function string class rs_sqlserver_function_class
    set username muser
    set password mpwd
    go
  7. Grant create object permission to rs_username on Replication Server:
    grant create object to rs_username
    go
    where rs_username is the user login name that Replication Agent uses for Replication Server access.
  8. For one instance of Replication Agent, set the ra_admin_owner, ra_admin_prefix, ra_admin_instance_prefix, rs_source_ds, and rs_source_db parameters:
    ra_config ra_admin_owner, ra_user_1
    ra_config ra_admin_prefix, ra_
    ra_config ra_admin_instance_prefix, ri1
    ra_config rs_source_ds, pds
    ra_config rs_source_db, pdb
    where
    • ra_user_1 is the user name used to create shared and instance objects in the primary database for use by Replication Agent instances. This user name must already be defined at the primary data server.
    • ra_ is the prefix used to identify share objects in the primary datbase. This prefix can be no longer than three characters.
    • ri1 is the prefix that uniquely identifies this Replication Agent instance in the replication group.
    • The value of rs_source_ds combined with the value of rs_source_db forms the connection name that this Replication Agent instance uses to connect to Replication Server.
  9. Initialize the Replication Agent instance:
    ra_admin init
  10. For the other instance of Replication Agent, set the ra_admin_owner, ra_admin_prefix, ra_admin_instance_prefix, rs_source_ds, and rs_source_db parameters:
    ra_config ra_admin_owner, ra_user_1
    ra_config ra_admin_prefix, ra_
    ra_config ra_admin_instance_prefix, ri2
    ra_config rs_source_ds, pds
    ra_config rs_source_db, conn2
    where
    • ri2 is the prefix that uniquely identifies this Replication Agent instance in the replication group.
    • The values of ra_admin_owner and ra_admin_prefix are the same as all other Replication Agent instances in the replication group.
    • The value of rs_source_ds combined with the value of rs_source_db forms the connection name that this Replication Agent instance uses to connect to Replication Server.
  11. Initialize the Replication Agent instance:
    ra_admin init
  12. Mark the two tables from Step1 for replication. On the Replication Agent instance identified by ri1:
    pdb_setreptable ptab1, mark
    go
    On the Replication Agent instance identified by ri2:
    pdb_setreptable ptab2, mark
    go
    where ptab1 and ptab2 are the primary database tables to be replicated.
  13. Create two replication definitions against the primary Oracle database:
    For example to create the ptab1_repdef replication definition for the ptab1 table:
    create replication definition ptab1_repdef
    with primary at pds.pdb
    with all tables named 'ptab1'
    ...
    go
    To create the ptab2_repdef replication definition for the ptab2 table:
    create replication definition ptab2_repdef
    with primary at pds.pdb
    with all tables named 'ptab2'
    ...
    go
    Note: These replication definitions must use the default primary connection name.
    If the primary connection and alternate primary connection are on different Replication Servers, create replication definitions on each Replication Server.
  14. Resume the Replication Agent instances:
    resume
    If the Replication Agent instance fails to resume, verify that LogMiner is installed and configured. See the Replication Agent Primary Database Guide > Replication Agent for Oracle > Oracle-Specific Considerations > Oracle Transaction and Operation Troubleshooting > Setting Up Replication Agent and Oracle to use ra_dumptran and ra_helpop.
  15. Create a subscription against the default replicate connection.
    For example, to create the ptab1_sub subscription for the ptab1_repdef replication definition:
    create subscription ptab1_sub 
    for ptab1_repdef
    with replicate at rds.rdb
    without materialization
    go
  16. Create a subscription against the alternate replicate connection.
    For example, to create the ptab2_sub subscription for the ptab2_repdef replication definition:
    create subscription ptab2_sub 
    for ptab2_repdef
    with replicate at rds.conn2
    without materialization
    go