如何在sql server 2012中将文章(表)添加到对等复制中

时间:2014-09-04 07:31:04

标签: sql sql-server replication p2p transactional-replication

我已在2个节点之间配置了对等复制。我一步一步地遵循了这个指示: http://www.databasejournal.com/features/mssql/article.php/3814591/Peer-to-Peer-Replication-in-SQL-Server-2008-150-Configure-a-two-node-topology.htm

然后我在向复制添加新文章(新表)时遇到了问题。我遵循了这条指令: http://msdn.microsoft.com/en-us/library/ms146867.aspx

它可以工作,但对于有很多表更改的环境来说这是不切实际的。 有谁知道更好的解决方案?我想快速自动地添加文章。

更新: 我已经使用sp_addarticle添加了一个表来发布。我没有停下来并启动日志阅读器代理。它似乎工作。它会在以后引起问题吗?

1 个答案:

答案 0 :(得分:1)

这涵盖在Administer a Peer-to-Peer Topology (Replication Transact-SQL Programming)

  

将文章添加到现有配置

1.  Quiesce the system.

2.  Execute the CREATE TABLE statement to add the new table at each node in the topology.

3.  Bulk copy the data for the new table manually at all nodes by using the bcp utility.

4.  Execute sp_addarticle to create the new article at each node in the topology. For more information, see Define an Article.

After sp_addarticle is executed, replication automatically adds the article to the subscriptions in the topology.

5.  Restart the Distribution Agents at each node in the topology.