如何向 SQL 2005 事务复制发布添加第二个订阅者
我设置了 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
听起来第二个订阅的目标表正在被复制(即,它已经是一个发布)。这就是错误所指示的内容。该表是否已存在于订阅数据库中?
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?
我想通了。在同步之前,我已将数据库备份恢复到启用复制的新订阅者。因此,大多数表的“表已复制”属性设置为 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!