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

在两台测试服务器部署了复制(发布订阅)后,发现订阅的表一直没有同步过来。重新生成过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

引用\[1\]中的代码片段是一个测试类,其中使用了Spring框架的@Autowired注解来注入一个ThreadPoolTaskExecutor对象。这个对象是用来执行多线程任务的线程池。在这个测试类中,通过调用poolTaskExecutor的execute方法来执行一个Runnable任务。这个任务会在一个新的线程中被执行,输出一条信息"要做的事情......."。\[1\] 引用\[2\]和\[3\]提到了TaskScheduler接口的两个方法,分别是schedule(Runnable task, Trigger trigger)和schedule(Runnable task, Instant startTime)。这两个方法都是用来执行定时任务的。其中,schedule方法使用cron表达式来指定任务的执行时间,而schedule方法则是在指定的时间点执行一次任务。\[2\]\[3\] 根据你的问题,'org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor' that could not be found.,这个错误提示说明在代码中找不到org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor类。可能的原因是你没有正确导入相关的包或者没有在项目的依赖中添加相应的jar文件。请检查你的代码和项目配置,确保正确导入了ThreadPoolTaskExecutor类所在的包,并且项目依赖中包含了相关的jar文件。 #### 引用[.reference_title] - *1* [Spring 线程池使用](https://blog.csdn.net/yk614294861/article/details/83003224)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] - *2* *3* [springboot中的线程池](https://blog.csdn.net/yaoct/article/details/119728243)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^koosearch_v1,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值