SQLServer Replication 常见错误
1. 错误:已将此(这些)订阅标记为不活动,必须将其重新初始化。需要删除NoSync 订阅,然后重新创建它们 use distributiongo -- 查找状态不正常的发布 select status, * from dbo.MSsubscriptions where status <> 2 修改状态 update set = 2 观察复制链是否能正常运行,正常后用tablediff比较发布链中的表数据是否一致 2. 错误:表、存储过程不存在以及表结构不一致等 有一种比较奇怪的现象是订阅端表明明存在,但是同步链依然报错,此时可能有两种情况:
( case when name = nvarchar ' then cast (b.max_length / AS varchar ) name like date% or money '' else name end ) sys.types system_type_id = b.system_type_id ) definition FROM dbo.sysarticles a WITH (NOLOCK) inner join sys.columns b (NOLOCK) on a.objid b. object_id dbo.syspublications c with (nolock) a.pubid c.pubid c.name Rp_XXXX and b.name xxx 3. 错误:.主键冲突 错误完成后,需要比较两边数据是否一致(比下数据量就行了) -------------跳过订阅机器上面的错误------------------------ -- ---------------------在分发机器上-------------------------- 语法 sp_helpsubscriptionerrors [ @publisher = ] publisher , @publisher_db = publisher_db ,0)"> @publication = publication @subscriber = subscriber @subscriber_db = subscriber_db get publisher subscriber MSsubscriber_info get publisher_db publication subscriber_db=publisher_db MSpublications example SQLw2k8 ,0)">dbtranpub dbtranpub_pub SQLw2k8Subscriber dbtransub 获取xact_seqno 值 --------------------在订阅机器上--------------------------- sp_setsubscriptionxactseqno @publisher= @publisher_db= @publication= @xact_seqno= xact_seqno ----------------------------------------------------------------------------------- 4. 错误:应用复制的命令时在订阅服务器上找不到该行 a. 可以采用“主键冲突”错误的处理方式,跳过错误,然后再用tablediff比较两个表的数据差; dbo.MSdistribution_history h dbo.MSrepl_errors e h.error_id e.id comments not %transaction% 失败的代理 order by id desc 用上面查到的具体事务序列号,查看复制组件执行的具体命令 在分发数据库上执行:sp_browsereplcmds,注意必须限定开始和结束xact_seqno sp_browsereplcmds 0x0000003B00000020000500000000 结果如下 article_id command 1 {CALL dbo . sp_MSdel_dboUPCCodeTransaction ( 000000002 )} 找到对应的对象 publisher_db,article From dbo.MSarticles article_id publication_id ( publication_id MSpublications publication Rp_xxx ) 由sp_MSdel 可以知道,这条命令是一个删除语句,因为发布端的数据已经不存在,所以只能跳过; 如果是修改,需要验证上述数据在故障订阅服务器上是否存在,如果不存在,则补上。 5. 错误:用户'xxx' 登录失败或者The process could not connect to Subscriber 'xxxx'. 6. 发布'xxx' 的初始快照尚不可用 7. 进程未能从表“[dbo].[syncobj_0x3745373834413345]”向外大容量复制 8. 错误消息: 发生这个错误一般都是在一台机器上面有比较多的发布链,错误原因在于数据库对Replication使用内存的限制, HKEY_LOCAL_MACHINESYSTEMCurrentControlSetControlSession ManagerSubSystems Windows2008 server 如果不是amdin用户可能会不让打开注册表,如果是管理组权限的话,可以到 9.--Cannot drop the database XXX because it is being used for replication ? http://www.cnblogs.com/fygh/archive/2011/07/04.html (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |