简体   繁体   English

SQL Server事务复制,并添加新表

[英]SQL Server transactional replication, and adding new tables

I have a very large existing set of tables being replicated (transactional) between two servers over a dedicated VPN connection. 我有一组非常庞大的现有表,这些表通过专用VPN连接在两台服务器之间进行复制(事务处理)。 I need to add a new table. 我需要添加一个新表。 Reloading all the tables is not an option. 重新加载所有表不是一种选择。

I thought that by simply adding the new articles to the publication it would replicate them across, but that didn't work. 我认为,只要将新文章添加到出版物中,就可以在整个文章中进行复制,但这是行不通的。 Of course, something needs to tell the subscriber about the new articles. 当然,需要向订户介绍新文章。 I then chose Generate Snapshot on the publisher, but I couldn't tell what it was doing (maybe scripting out all the data?) so I shut it down. 然后,我在发布者上选择了“生成快照”,但是我无法确定它在做什么(也许是脚本化所有数据吗?),所以我将其关闭。 Maybe I should have let it run? 也许我应该让它运行? I'm not sure. 我不确定。

So how do I safely add the new articles to the existing subscription? 那么,如何安全地将新文章添加到现有订阅中?

I found the answer. 我找到了答案。 The problem is that I did not use the initial snapshot to initialize the subscriber in the first place. 问题在于,我最初没有使用初始快照来初始化订户。 I used a different method (the backup and restore method), which means I have to manually transfer the schema and data before starting up the transactional replication process. 我使用了另一种方法(备份和还原方法),这意味着我必须在启动事务复制过程之前手动传输架构和数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM