Creating Multiple Replication Paths for MSA Environments

Use replication definitions and subscriptions to bind a replicate connection for a replicate database and a primary connection for a primary database to create two complete replication paths in an MSA environment.

  1. Divide transactions into two sets and ensure the transactions can be run in parallel.
    For example, you can divide the transactions into two sets of objects such as tables or stored procedures.
  2. Create a default primary connection to the primary database and create a default replicate connection to the replicate database.
  3. Create an alternate primary connection to the primary database and create an alternate replicate connection to the replicate database.
  4. Enable multithreaded RepAgent and two replication paths for RepAgent, and bind the objects to the replication paths.
  5. Create a replication definition against the primary database.
    If the default primary connection and the alternate primary connection are on different Replication Servers, create replication definitions on each Replication Server or one Replication Server, depending on whether there is a route between the two Replication Servers.

    For example, if you have created Replication Servers REPX157 (= ID server) and REPX157A, using rs_init resource files, and REPX157 has a default primary connection X157.primdb and default replicate connection X155.repdb:

    On REPX157A, the alternate connection X157.primdb_A is created as:
    create alternate connection to X157.primdb named X157.primdb_A
    set error  class to rs_sqlserver_error_class
    set function string class to  rs_sqlserver_function_class
    set username to primdb_maint
    set password to  primdb_maint_ps with primary only
    go
    On REPX157A, alternate replication connection X155.repdb_A is created as:
    create alternate connection to X155.repdb named X155.repdb_A
    set error  class to rs_sqlserver_error_class
    set function string class to rs_sqlserver_function_class
    set username to repdb_maint
    set password to repdb_maint_ps
    go 

    If there is route from the Replication Server where default connection exists to the one where alternate connection exists. Database replication definition information is automatically shared by both Replication Servers. Therefore, in the case above, you need to create database replication definition only once on REPX157.

    On REPX157:
    create database replication definition primdb_A with primary at  X157.primdb
    go 

    If there is no route from the Replication Server where default connection exists to the one where alternate connection exists. To subscribe to the primary database, you have to execute the same create database replication definition command again on REPX157A to share the information of primdb_A:

    On REPX157A:
    create database replication definition primdb_A with primary at  X157.primdb
    go 
  6. Create a subscription against the default primary connection and the default replicate connection.
  7. Create a subscription against the alternate primary connection and the alternate replicate connection.
    For example, if you intend to replicate database from alternate primary connection to alternate replicate connection to use two paths, create database subscription as follows:
    On REPX157A:
    create subscription primdb_A_sub 
    for database replication definition primdb_A 
    with primary at X157.primdb_A 
    with replicate at X155.repdb_A 
    without materialization
    go