加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > MsSql教程 > 正文

SQLSERVER 2012 Reinitial single article

发布时间:2020-12-12 13:24:26 所属栏目:MsSql教程 来源:网络整理
导读:当遇到下列问题时 The initial SnapShot for Article " xxx " is not yet available, 可以单独对这个article做初始化,方法如下: 具体publication和subscriber名字可通过 S P_HELPPUBLICATION 和SP_HLEPSBUCRIBTION 获取 1. First,we turn off @allow_anon

当遇到下列问题时

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


??

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读