Friday 17 January 2014

multipath replication support



PRIMSERVER_RS ---> REPSERV ---> PRIMSERVER  

-----------------------------------------------
create replication definition repdef_db1_test1
with primary at PRIMSERVER.db1
with primary table named 'test1'
with replicate table named 'test1'
(id INTEGER , Fullname varchar(20))
primary key (id)
go

create subscription sub_db1_test1
for repdef_db1_test1
with replicate at REPSERV.db1
without materialization

check subscription sub_db1_test1
for repdef_db1_test1
with replicate at REPSERV.db1
go

-----------------------------------------------
create replication definition repdef_db1test2
with primary at PRIMSERVER.db1
with primary table named 'test2'
with replicate table named 'test2'
(id INTEGER , detail varchar(20))
primary key (id)
go

create subscription sub_db1test2
for repdef_db1test2
with replicate at REPSERV.db1
without materialization

check subscription sub_db1test2
for repdef_db1test2
with replicate at REPSERV.db1

--------------------------------------------------

drop subscription sub_db1test2
for database replication definition  repdef_db1test2
with primary at PRIMSERVER.db1
with replicate at REPSERV.db1
without purge

create table test1(id INTEGER , fullname varchar(10))

create table test2(id INTEGER , fullname varchar(10))

insert into test1 values(1,"SM")
insert into test1 values(2,"AM")
insert into test1 values(3,"DM")
insert into test1 values(4,"UM")
insert into test1 values(5,"PM")

1.  RS user:  PRIMSERVER_RS_ra                                                
2.  RS password:  PRIMSERVER_RS_ra_ps

sp_replication_path db1, 'config', "alternate_Rep_path","rs_username", userid
---------------------------------------
default(single path) replication heartbeat
@D30
exec sp_setreplicate 'rs_marker' , true
exec rs_ticket 'heartbeat'

@D28
1> use db1
2> go
1> select * from rs_ticket_history
2> go
 cnt       pdb_t                         rdb_t
---       -------------------           -------------------
  1       Jan 19 2010  2:17AM           Jan 19 2010  2:17AM
 
ticket
-----------------------------------------------------------
V=2;H1=profile1;H2=start;PDB(pdb)=01/19/10 02:17:19.406;
EXEC(40)=01/19/10 02:17:19.423;B(40)=1332;
DIST(26)=01/19/10 02:17:19.669;
DSI(35)=01/19/10 02:17:19.916;
DSI_T=1;DSI_C=3;RRS=SAMPLE_RS_XIEL
./rs_init

@primase

1> sp_config_rep_agent db1,'multithread rep agent' , true
2> go
 Parameter_Name        Default_Value Config_Value Run_Value
 --------------------- ------------- ------------ ---------
 multithread rep agent false         true         false    

(1 row affected)
1> sp_stop_rep_agent db1
2> go
1> sp_start_rep_agent  db1
2> go

4) Set the multiple replication paths (4) for RepAgent--->

1> sp_config_rep_agent db1,'max number replication paths','4'
2> go
 Parameter_Name               Default_Value Config_Value Run_Value
 ---------------------------- ------------- ------------ ---------
 max number replication paths 1             4            1        


At the primary Adaptive Server, enter:
1> sp_replication_path "db1", 'add',"alternate_Rep_path", "PRIMSERVER_RS","PRIMSERVER_RS_maint", "PRIMSERVER_RS_Maint_ps"
2> go
@status1:
            
 -----------
           0
Create an alternate replication path from the primary database to Replication Server---->

create alternate connection to PRIMSERVER.db1
named PRIMSERVER.alternate_Rep_path
set error class to rs_sqlserver_error_class
set function string class to rs_sqlserver_function_class
set username to db1_maint
set password to db1_Maint_ps
with primary only
go

create alternate connection to REPSERV.db1
named REPSERV.alternate_Rep_path
go
Alternate connection RepSer.alternate_Rep_path' to database
RepSer.db1' is created.

---------------------------
 sp_replication_path db1 ,'bind',"table","test2","alternate_Rep_path"
 go
@status1:
            
sp_config_rep_agent db1, 'enable', 'PRIMSERVER_RS',  'PRIMSERVER_RS_maint', 'PRIMSERVER_RS_maint_ps