Set up a multipath replication replication system with two primary and replicate connections for end-to-end replication from an Adaptive Server primary to a Sybase IQ replicate database.
The replication system in this scenario consists of the pdb database in the ASE_DS primary Adaptive Server, the IQSRVR replicate Sybase IQ data server containing the iqdb database, the PRS primary Replication Server, and the testtab1 and testtab2 tables.
Use create connection or rs_init to create the default connection. See Replication Server Configuration Guide > Configure Replication Server and Add Databases using rs_init.
sp_config_rep_agent pdb, ‘multithread rep agent’, ‘true’
sp_config_rep_agent pdb, 'max number of replication paths', '2'
sp_replication_path "pdb", 'add', "pdb_conn2", "PRS", "dbmaint2", "dbmaint2pwd"
create alternate connection to ASE_DS.pdb named ASE_DS.pdb_conn2 set error class to rs_sqlserver_error_class set function string class to rs_sqlserver_function_class set username to dbmaint2 set password to dbmaint2pwd with primary only
You must specify the connection profile and connection profile version, and a unique maintenance user name for the default connection and each alternate connection.
create connection to IQSRVR.iqdb using profile rs_ase_to_iq;standard set username to dbmaint1 set password to dbmaint1 go
create alternate connection to IQSRVR.iqdb named IQSRVR.pdb_conn2 using profile rs_ase_to_iq;standard set username to dbmaint2 set password to dbmaint2pwd go
create alternate connection to IQSRVR2.pdb_conn3 named IQSRVR2.iqdb2_conn1 using profile rs_ase_to_iq;standard set username to dbmaint3 set password to dbmaint3pwd go
alter connection to IQSRVR.iqdb set dsi_compile_enable to ‘on’ go
alter connection to IQSRVR.pdb_conn2 set dsi_compile_enable to ‘on’ go
suspend connection to IQSRVR.iqdb go suspend connection to IQSRVR.pdb_conn2 go resume connection to IQSRVR.iqdb go resume connection to IQSRVR.pdb_conn2 go
sp_setreptable testtab1,'true' go sp_setreptable testtab2,'true' go
sp_config_rep_agent pdb, ‘multipath distribution model’, 'object’
sp_replication_path pdb, 'bind', "table", "dbo.testtab2", "pdb_conn2"
create replication definition repdef_testtab1 with primary at ASE_DS.pdb1 with primary table named ‘testtab1’ with replicate table named dbo.‘testtab1’ (c1 int, c2 int, c3 char(10)) primary key(c1) go
create replication definition repdef_testtab2 with primary at ASE_DS.pdb1 with primary table named ‘testtab2’ with replicate table named dbo.‘testtab2’ (c1 int, c2 int, c3 char(10)) primary key(c1) go
create subscription sub_testtab1 for repdef_testtab1 with replicate at IQSRVR.iqdb without materialization go
create subscription sub_testtab2 for repdef_testtab2 with replicate at IQSRVR.pdb_conn2 without materialization go