1.
安装REP1,是ID server,RSSD需要复制(Rep Agent)DBTEST1要复制(Rep Agent)
2.
安装REP2,不是ID server,有RSSD不要复制。
3.
建REP1—>REP2的单项路由,在REP1上建;
isql –Usa –Ppass –SREP1 >create route to REP2 >set username REP2_rsi >set password REP2_rsi_ps >go 4 在TEST1(主点数据服务器)建一个复制用户:
isql –Usa –Ppass –STEST1 >sp_addlogin repsys,repsys_ps >go (repsys 密码repsys_ps) >use dbtest1 >go >sp_adduser repsys >go >grant all on rep_table to repsys >go (对要复制的表rep_table授权) 5 将复制用户repsys加到REP1(主点复制服务器)REP2(复制点复制服务器)上,并将create object 权限授予该用户。(注意,此”repsys”用户在REP1和REP2及TEST1上必须用相同的登录名和口令)
isql –Usa –Ppass –SREP1 >create user repsys >set password repsys_ps >go >grant create object to repsys >go isql –Usa –Ppass –SREP2 >create user repsys >set password repsys_ps >go >grant create object to repsys >go 6 在REP1上创建复制定义(注意用户)
isql –Urepsys –Prepsys_ps –UREP1 >create replication definition dbtest1_repdef >with primary at TEST1.dbtest1 >with all tables named ‘rep_table’ >(num1 datatype,num2 datatype,…….) >primary key(num) >searchtable columns(num1,num2,……) >go 7 将DBTEST1中dbtest1要复制的表设为可复制
isql –Usa –Ppass –STEST1 >use dbtest1 >go >sp_setreptable rep_table,true >go 8 给TEST2中dbtest2中要复制的表授权
isql –Usa –Ppass –STEST2 >use dbtest2 >go >grant all on rep_table to dbtest2_maint >go 9 在REP2上建预定
isql –Urepsys –Prepsys_ps –SREP2 >create subscription dbtest1_sub >for dbtest1_repdef >with replicate at TEST2.dbtest2 >subscribe to truncate table >with materialization (初始化) 10 验证在REP1和REP2上
isql –Usa –Ppass –SREP1 >admin_health >go >admin_who >go >admin_who_is_down >go isql –Usa –Ppass –SREP2 >admin health >go >admin who >go >admin who_is_down >go
没弄过,上面是别的地方看来的。 |