+ -
当前位置:首页 → 问答吧 → youwei和其他对rep感兴趣的看进来,--用RS12.6整库复制

youwei和其他对rep感兴趣的看进来,--用RS12.6整库复制

时间:2010-11-22

来源:互联网

这个是我以前的工作笔记,但愿对你们有用。

1. 用rs_init将主,备库都加入复制系统
2. 在源库上使用sp_reptostandby dbname,'all'将其标记为热备库
3. 创建逻辑连接,create logical connection to dataserver.dbname
4. 用sp_config_rep_agent 'send warm to standby xacts',true将主,从两库的rep agent都配置开传输xacts
5. 用sp_role "grant",replication_role,maintuser将源库的maint用户赋予replication_role权限
6. 如需将truncate table命令也一并复制的话,应在rep server上执行
alter logical connection to ds.dbname set send_truncate_table to 'on'并重启dsi
7. 然后建立复制定义,类似
   create database replication definition repdb_def
   with primary at test.repdb1
   replicate DDL
   replicate system procedures
   go
8. 再建立预订,类似
   create subscription repdb_sub for database replication definition repdb_def
   with primary at test.repdb1
   with replicate at test.repdb2
   without materialization
   go

作者: Eisen   发布时间: 2010-11-22

好淫哪好淫!

作者: wfcjz   发布时间: 2010-11-22