The concurrent snapshot for publication 'xxx' is not available because it has not been fully generat...

本文介绍了解决SQL Server发布订阅同步失败的问题,通过删除残留的发布订阅设置并重新创建来修复同步错误。

在两台测试服务器部署了复制(发布订阅)后,发现订阅的表一直没有同步过来。重新生成过snapshot ,也重新初始化过订阅,都不能同步数据,后面检查Distributor To Subscriber History, 发现有如下日志信息:

The concurrent snapshot for publication 'RPL_PUB_Tecdb' is not available because it has not been fully generated or the Log Reader Agent is not running to activate it. If generation of the concurrent snapshot was interrupted, the Snapshot Agent for the .....

 

 

这个可能是因为以前配置过这个数据库的发布订阅,但是由于某些原因,没有清理干净。我参考网上http://stackoverflow.com/questions/1018339/the-concurrent-snapshot-for-publication-xx-is-not-available-because-it-has-not的解决方案 ,连续测试了几个发布订阅,都能完美解决这个问题,特此记录一下,方面以后遇到该问题能顺速解决。

 

1:首先删除对应的发布订阅(publication & subscription ).

 

2: 查看关于发布订阅的一些信息

SELECT  *
FROM    msdb..MSdistpublishers;
 
SELECT  *
FROM    distribution..MSpublisher_databases;
 
SELECT  *
FROM    distribution..MSpublications;
 
SELECT  *
FROM    distribution..MSarticles;
 
SELECT  *
FROM    distribution..MSsubscriptions;

 

其实这里面只需要查看distribution..MSpublisher_databases、distribution..MSarticles 、distribution..MSsubscriptions

 

 

3: 从MSarticles、MSsubscriptions 中删除对应的数据

DELETE  FROM distribution..MSarticles
WHERE   publisher_db = '<NameOfDatabase>';
 
 
DELETE  FROM distribution..MSsubscriptions
WHERE   publisher_db = '<NameOfDatabase>';

 

4: 重新创建发布、订阅。问题解决。

 

参考资料:

http://stackoverflow.com/questions/1018339/the-concurrent-snapshot-for-publication-xx-is-not-available-because-it-has-not

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值