为什么Microsoft文档建议使用@immediate_sync来初始化备份中的复制 [英] Why does Microsoft document recommends @immediate_sync for initializing a replication from backup

查看:58
本文介绍了为什么Microsoft文档建议使用@immediate_sync来初始化备份中的复制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

 我正在从备份中读取同步
documentation
。 在步骤2中,在警告下显示

 I am reading the sync from backup documentation.  In step 2, under warning it says

为了避免丢失订户数据,当使用带有@allow_initialize_from_backup = N'true'的sp_addpublication时,请始终使用@immediate_sync = N'true'。

为什么我们需要使用  @immediate_sync? 我已经测试过没有它,只要我们在分发数据库中有可用的事务,它似乎不会丢失数据。

Why do we need to use @immediate_sync? I have tested without it and it seems to not lose data as long as we have the transactions available in the distribution database.

推荐答案

如果设置为0,那么在将命令传递给所有订阅者时,命令将从MSRepl_commands中删除... 72小时在这种情况下,大多数复制每两分钟运行
分钟,因此命令不需要保留超过大约3分钟,然后才能删除。 




因此我运行以下代码将标志设置为0 ...



-  检查  ;要查看 如果 "" immediate  sync"            ;在  MSRepl_commands 

- 而不是 删除 当分发时。
 

exec   dbo sp_helppublication   @ publication   =   ''  -  把你的出版物名称 在这里  



-  如何将 设置更改为  0。  

EXEC   sp_changepublication  

     @ publication   =   '' < span style ="color:silver">,
  -   put 您的出版物名称  here  

     @ property   =   'allow_anonymous'  

     @ value   =   'false' 

GO  



EXEC   sp_changepublication  

     @ publication   =   ''   -  把你的出版物名称 在这里  

     @ property   =   'immediate_sync'  

     @ value   =   'false' 

if it is set to 0 then commands are removed from MSRepl_commands the moment that they have been passed to all subscribers… not held for the full 72 hours. In this case most replication runs every couple of minutes and therefore commands don’t need to be held for more than roughly 3 mins before they can be deleted. 

Therefore I ran the following code to set the flag to 0…

-- Check to see if "immediate sync" is set to 1.
--  This will cause transactions to be held in MSRepl_commands 
-- rather than deleted when distributed.
 
exec dbo.sp_helppublication @publication = '' -- put your publication name here 

-- How to alter the setting to 0. 
EXEC sp_changepublication 
    @publication = '', -- put your publication name here 
    @property = 'allow_anonymous', 
    @value = 'false' 
GO 

EXEC sp_changepublication 
    @publication = '', -- put your publication name here 
    @property = 'immediate_sync', 
    @value = 'false' 

参考


这篇关于为什么Microsoft文档建议使用@immediate_sync来初始化备份中的复制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆