- 论坛徽章:
- 0
|
我现在做的是test1库整库复制到test2库,再由test2库表级复制到test3库(test2库跟test3库在一台主机上)。
整库复制创建成功后,按照以下步骤创建表级复制:
1. 主点允许复制
use test2
go
sp_setreptable t_table ,true
go
2. 定义TXT定义
sp_setrepcol t_table, beizhu,replicate_if_changed
go
3.设置用户连接
use test2
go
sp_dropuser test2_maint
go
sp_addalias test2_maint ,dbo
go
grant role sa_role to test2_maint
go
use test3
go
sp_dropuser test3_maint
go
sp_addalias test3_maint ,dbo
go
grant role sa_role to test3_maint
go
4.出版 --RS执行
create publication "test3_aa"
with primary at B.test2
create replication definition "test3_1402"
with primary at B.test2
with all tables named "a"
( "a" char(10),
"b" char(10))
primary key("a")
send standby all columns
replicate all columns
create article "a"
for "test3_aa"
with primary at B.test2
with replication definition "test3_1402"
validate publication "test3_aa"
with primary at B.test2
5.订阅 --RS执行
create subscription sub_test3
for publication test3_aa
with primary at B.test2
with replicate at B.test3
subscribe to truncate table
以上步骤执行完之后测试,test3中a表数据并未复制到,错误日志为:
I. 2010/11/23 11:13:56. _SUB_RECOVERY_DAEMON: Retrying materialization for subscription <aa> for article <a> with replicate at <YKZ20101118BPJ.sbtest> for the 527 time
I. 2010/11/23 11:13:56. SQM stopping: 104:-2147483545 a.aa
I. 2010/11/23 11:13:56. SQM starting: 104:-2147483545 a.aa
E. 2010/11/23 11:13:56. ERROR #1028 SUB(aa) - seful\cm.c(3463)
Message from server: Message: 4002, State 1, Severity 14 -- 'Login failed.
'.
E. 2010/11/23 11:13:56. ERROR #1027 SUB(aa) - seful\cm.c(3463)
Open Client Client-Library error: Error: 67175468, Severity 4 -- 'ct_connect(): protocol specific layer: external error: The attempt to connect to the server failed.'.
E. 2010/11/23 11:13:56. ERROR #13045 SUB(aa) - seful\cm.c(3467)
Failed to connect to server 'YKZ20101118BPJ' as user 'sa'. See CT-Lib and/or server error messages for more information.
为什么会这样?请各位高手支招!谢谢了! |
|