如何配置复制?- 此数据库未启用发布 [英] How to configure replication? - This database is not enabled for publication
问题描述
我正在尝试在 SQL Server 2005 上配置复制.我可以使用向导来完成.但是,当我尝试通过此向导运行生成的脚本时,会出现错误消息:
I'm trying to configure replication on SQL Server 2005. I can do it using wizard. But when I'm trying to run generated scripts by this wizard the error message appears:
Msg 14013, Level 16, State 1, Procedure sp_MSrepl_addpublication, Line 159
This database is not enabled for publication.
Msg 18757, Level 16, State 1, Procedure sp_MSrepl_addpublication_snapshot, Line 66
Unable to execute procedure. The database is not published. Execute the procedure in a database that is published for replication.
Msg 14013, Level 16, State 1, Procedure sp_MSrepl_addarticle, Line 168
This database is not enabled for publication.
Msg 14294, Level 16, State 1, Procedure sp_verify_job_identifiers, Line 25
Supply either @job_id or @job_name to identify the job.
这有点奇怪,因为当我在单击然后删除发布的数据库上运行此查询时,一切都进行得很顺利.问题是当我在新数据库上使用查询时.更重要的是,我正在使用 sp_replicationdboption 存储过程.当我尝试运行它时,它说:
It's a bit strange, because when I'm running this query on database where I clicked and then removed publication, everyting is going well. The problem is when I'm using my query on new database. What is more I'm using sp_replicationdboption stored procedure. When I'm tryin to run it, it says:
数据库ReplicationTest00
的复制选项publish
已经设置为true.
The replication option publish
of database ReplicationTest00
has already been set to true.
请帮我解决这个问题.
推荐答案
好的,我找到了这个问题的解决方案.我试图在产生上述错误消息的整个 sql server 的上下文中运行 snapshor 复制脚本.
Ok I found solution for this issue. I was tring to run snapshor replication script in context of whole sql server which was producing above error message.
当我在数据库的上下文中运行我的脚本时,它作为分发器用于复制,它完美地工作.:)
When I was running my script in conctext of database which is used for replication as distributor it works perfectly. :)
这篇关于如何配置复制?- 此数据库未启用发布的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!