Multi-Path Replication from Oracle to Oracle

Set up a Multi-Path Replication system with two primary and replicate connections for end-to-end replication from an Oracle primary to an Oracle 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. 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.

  3. 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
  4. Copy the tnsnames.ora file for your replicate Oracle database to the Replication Server RS_installation_directory\ REP-15_5\connector\oraoci\network\admin directory, and restart Replication Server.
  5. Create a connection to the replicate Oracle database through ExpressConnect for Oracle.
    create connection to tns_alias_name.rdb
    using profile rs_oracle_to_oracle;eco
    set username muser
    set password mpwd
    set dsi_dataserver_make to 'ora'
    set dsi_connector_type to 'oci'
    set batch to 'off'
    go
    where:
    • tns_alias_name is the alias name for the replicate Oracle database defined in the tnsnames.ora file for the replicate Oracle database.
    • rdb is the replicate Oracle System ID (SID) that is paired with the above tns_alias_name in the tnsnames.ora file. The default value is ORCL.

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

    • mpwd is the replicate Oracle maintenance user password.

    See the ExpressConnect for Oracle Installation and Configuration Guide for more information about naming the default connection.
  6. Create an alternate connection to the replicate Oracle database through ExpressConnect for Oracle.
    create alternate connection to tns_alias_name.rdb
    named tns_alias_name.conn2
    set error class rs_oracle_error_class
    set function string class rs_oracle_function_class 
    set username muser
    set password mpwd
    set dsi_dataserver_make to 'ora'
    set dsi_dataserver_type to 'oci'
    set batch to 'off'
    set dsi_proc_as_rpc to 'on'
    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 tns_alias_name.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 tns_alias_name.conn2
    without materialization
    go
Related concepts
Oracle as Replicate Data Server