SQL Server Replication : Removing broken subscriptions at the publisher

久未见 提交于 2019-12-12 15:06:31

问题


We have multiple subscriptions (merge pull) at our subscriber for only 1 "real" subscription. I think we actually broke it like this by adding and removing the subscription from the subscriber side, and then trying to replicate it... multiple times.

Now the problem is not that the replication does not work, I'm pretty confident that I the answer for that. The problem is that I can't drop/delete the broken subscriptions at the subscriber anymore. It just does not work.

When trying to run sp_dropmergepullsubscription at the publisher, it tells me "No subscription is on this publication article".

When trying to run sp_dropsubscription at the publisher, it tells me "This database is not enabled for subscription"

Yes I've checked that I was running all these scripts on the correct database and all that.

Has anybody had a problem like this before ? Do I need to re-do the publication and the subscription ?

Thanks guys and gals ! :)


回答1:


Try the following on the publisher:

EXEC sp_dropmergesubscription 
  @publication = '<publicationName>', 
  @subscriber = '<subscriberName>',
  @subscriber_db = '<dbName>;
GO

delete sysmergesubscriptions where subscriber_server = '<subscriberName>'

use distribution
go 
delete msmerge_Agents where subscriber_name = '<subscriberName>'

delete msmerge_subscriptions where subscriber = '<subscriberName>' 

...then try setting the pull subscription back up



来源:https://stackoverflow.com/questions/7876913/sql-server-replication-removing-broken-subscriptions-at-the-publisher

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!