Multi-Path Replication Quick Start

Set up a multi-path replication replication system comprising of two primary and replicate paths for end-to-end replication and bind a table to the alternate replication path.

  1. Select or create two sets of tables or stored procedures that you want to replicate through two replication paths.
  2. Use rs_init to add the primary and replicate Adaptive Server databases to the replication system.
  3. Enable multithreaded RepAgent.
    At the primary Adaptive Server, enter:
    sp_config_rep_agent primary_database_name, ‘multithread rep agent’, ‘true’
    go
  4. Set the number of replication paths for RepAgent.
    For example, to enable two paths, enter:
    sp_config_rep_agent primary_database_name, 'max number replication paths', '2'
    go
    
  5. Create an alternate replication path from the primary database to Replication Server.
    1. Create the alternate RepAgent replication path named alternate_path_name.
      At the primary Adaptive Server, enter:
      sp_replication_path 'primary_database_name', 'add',
      'alternate_path_name', 'repserver_name',
      'repserver_user', 'repserver_password'
      go
    2. Create the corresponding alternate primary connection from Replication Server to the primary database and bind it to the alternate RepAgent replication path by using the same RepAgent replication path name—alternate_path_name.
      At the Replication Server, enter:
      create alternate connection to primary_dataserver.primary_database
      named primary_dataserver.alternate_path_name
      set error class to rs_sqlserver_error_class
      set function string class to rs_sqlserver_function_class
      set username to primary_db_maintenance_user
      set password to primary_db_maintenance_password
      with primary only
      go

      See create alternate connection in the Replication Server Reference Manual for parameter descriptions and examples.

    The replication system contains two primary replication paths—the default and alternate_path_name
  6. Restart RepAgent.
    sp_stop_rep_agent primary_database_name
    go
    sp_start_rep_agent primary_database_name
    go
  7. Create an alternate replicate connection from Replication Server to the replicate database using the same alternate replication path name—alternate_path_name.
    create alternate connection to replicate_dataserver.replicate_database
    named replicate_dataserver.alternate_path_name
    go
    The replication system contains two replicate replication paths—the default and alternate_path_name
  8. Bind one set of objects such as tables or stored procedures to the alternate replication path.
    sp_replication_path pdb, 'bind', "table", "[table_owner].table_name", "alternate_path_name"
    go
    The other set of objects uses the default replication path. You can only bind objects to alternate replication paths. All objects that you do not bind to an alternate replication path, use the default path instead.
  9. Verify object bindings.
    sp_replication_path primary_database_name,'list'
    go
  10. Verify the number of replication paths that are active.
    Use admin who at the Replication Server, and sp who and sp_replication_path at the primary Adaptive Server. See admin who and sp_replication_path in the Replication Server Reference Manual, and sp who in the Adaptive Server Enterprise Reference Manual: Procedures.
  11. Create a replication definition against the primary database.
    For example to create the authors_rep replication definition for the authors table:
    create replication definition authors_rep
    with primary at primary_dataserver.primary_database
    with all tables named 'authors'
    ...
    go
    If the default primary connection and the alternate primary connection are on different Replication Servers, create replication definitions on each Replication Server.
  12. Create a subscription against the default primary connection and the default replicate connection using theauthors_rep replication definition.
    create subscription subscription_default_path for authors_rep
    with primary at primary_dataserver.primary_database
    with replicate at replicate_dataserver.replicate_database
    go
  13. Create a subscription against the alternate primary connection and the alternate replicate connection using theauthors_rep replication definition.
    create subscription subscription_alternate_path for authors_rep
    with primary at primary_dataserver.alternate_path_name
    with replicate at replicate_dataserver.alternate_path_name
    go
  14. To verify that the replication paths are being used, use admin stats, bps before and after the multipath replication system inserts data into the replication paths and see the values for the DSI theads for the replication paths. See admin stats, bps in the Replication Server Reference Manual.