如何向 SQL 2005 事务复制发布添加第二个订阅者

发布于 2024-09-13 22:15:30 字数 205 浏览 3 评论 0原文

我设置了 SQL 2005 事务复制,其中一个主数据库充当发布者,一个订阅者。运行良好。现在,我想为该出版物添加第二个订阅者。我在第二台服务器上创建了订阅,并创建了快照,但当它开始同步时,我收到错误

“无法删除表‘xxxxx’,因为它正用于复制。”

如何将第二个订阅者添加到已有一名订阅者的现有出版物中?我不想停止已经存在并且工作正常的第一个订阅(如果可能的话)。

I have setup SQL 2005 Transactional Replication, with one master database acting as the publisher, and one subscriber. It's running fine. Now, I want to add a second subscriber to this publication. I created the subscription on the second server, and created the snapshot ok, but when it starts to syncronize I get the error

"Cannot drop the table 'xxxxx' because it is being used for replication."

How do I add a second subscriber to an existing publication that already has one subscriber? I don't want to stop the first subscription that already exists and is working fine if possible.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

夏末 2024-09-20 22:15:30

听起来第二个订阅的目标表正在被复制(即,它已经是一个发布)。这就是错误所指示的内容。该表是否已存在于订阅数据库中?

It sounds like your target table for the second subscription is being replicated (i.e., it's already a publication). That's what the error indicates. Does the table already exist on the subscribing database?

別甾虛僞 2024-09-20 22:15:30

我想通了。在同步之前,我已将数据库备份恢复到启用复制的新订阅者。因此,大多数表的“表已复制”属性设置为 True。我在数据库(在新订户上)上运行了 sp_removedbreplication,并将所有表的该属性设置为 False,从而允许同步正常工作而不会出现错误。

谢谢!

I figured it out. Before syncronizing I had restored a backup of the database to the new subscriber that was enabled for replication. So most of the tables had the "Table is replicated" property set to True. I ran sp_removedbreplication on the database (on the new subscriber) and it set that property to False for all the tables which allowed the syncronization to work without errors.

thanks!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文