MsSQL   发布时间:2022-05-16  发布网站:大佬教程  code.js-code.com
大佬教程收集整理的这篇文章主要介绍了SQLSERVER 2012 Reinitial single article大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。

当遇到下列问题时

The initialSnapShotforArticle "xxx" isnotyetavailable,可以单独对这个article做初始化,方法如下:

具体publication和subscriber名字可通过 SP_HELPPUBLICATION 和SP_HLEPSBUCRIBTION 获取

1. First,we turn off @allow_anonymous and @immediate_sync on the publication by doing the following:

EXEC sp_changepublication
@publication = ‘testpublication’,
@property = N’allow_anonymous’,
@value = ‘false’
GO

EXEC sp_changepublication
@publication = ‘testpublication’,
@property = N’immediate_sync’,
@value = ‘false’
GO


2. Then,we drop the article from the subscription.

EXEC sp_dropsubscription
@publication = ‘testpublication’,
@subscriber = ‘subscriber_name’,
@article = ‘article_we_want_to_change’


3. Next,we want to force an invalidate of the snapshot.

EXEC sp_droparticle
@publication = ‘testpublication’,
@article = ‘article_we_want_to_change’,
@force_invalidate_snapshot = 1


4. Now change the schema of the article we just removed from the subscription.


5. Then,we add the article we want to change back to the publication.

EXEC sp_addarticle
@publication = ‘testpublication’,
@source_object = ‘article_we_want_to_change’,
@force_invalidate_snapshot = 1


6. We will then want to refresh the subscription.

EXEC sp_refreshsubscriptions @publication = ‘testpublication’


7. start your snapshot agent which will snapshot only the article that we made changes to.


8. Next re-add the @immediate_sync and @allow_anonymous.

EXEC sp_changepublication
@publication = ‘testpublication’,
@value = ‘true’
GO

EXEC sp_changepublication

@publication = ‘testpublication’,
@value = ‘true’
GO




大佬总结

以上是大佬教程为你收集整理的SQLSERVER 2012 Reinitial single article全部内容,希望文章能够帮你解决SQLSERVER 2012 Reinitial single article所遇到的程序开发问题。

如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。

本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。
标签: