SQL Server2000教程 SQL Server2005教程SQL Server2008教程 SQL SERVER2012教程
返回首页

MS SQL 2008 发布订阅配置错误总结

时间:2013-06-29 09:01来源:未知 作者:潇湘隐者 点击:我要投稿  高质量的ASP.NET空间,完美支持1.0/2.0/3.5/4.0/MVC等

最近在配置SQL 2008的发布订阅功能时,遇到了几个小错误,顺便归纳总结一下(以后碰到各类关于发布订阅的错误都将收录、更新到这篇文章),方便自己在以后碰到这类问题时,能够迅速解决问题。毕竟人的记忆能力有时效性,时间久了,有可能有些东西就模糊了或忘了,好记性不如烂笔头。

错误1:在数据库服务器上新建本地发布服务时报错。

 

clipboard

                                                      (图1)

报错的具体细节如下所示:

TITLE: New Publication Wizard
------------------------------
 
Microsoft SQL Server Management Studio is unable to access replication components because replication is not installed on this instance of SQL Server. For information about installing replication, see the topic Installing Replication in SQL Server Books Online.
 
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.1600.1&EvtSrc=Microsoft.SqlServer.Management.UI.ReplUtilitiesErrorSR&EvtID=ReplicationNotInstalled&LinkId=20476
 
------------------------------
ADDITIONAL INFORMATION:
 
Replication components are not installed on this server. Run SQL Server Setup again and select the option to install replication. (Microsoft SQL Server, Error: 21028)
 
For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=10.50.4000&EvtSrc=MSSQLServer&EvtID=21028&LinkId=20476
 
------------------------------
BUTTONS:
 
OK
------------------------------
View Code

 查看具体原因,是因为安装数据库实例时,没有选择安装Replication components,需要添加Replication components,首先找到安装光盘或安装镜像文件,挂载到光驱或拷贝到某个文件目录,例如,我这边挂载后的安装介质位于Z盘,在运行里面输入cmd命令,转到Z盘,输入下面命令:

setup.exe /q /Features=Replication /InstanceName=MSSQLSERVER /ACTION=INSTALL /IAcceptSQLServerLicenseTerms ,然后耐心等待安装完成,从网上搜索的资料看,好像下面命令start /wait X:\Servers\setup.exe /qb INSTANCENAME=MSSQLSERVER ADDLOCAL=SQL_Replication也可,不过,这条命令我还没有试验过。不保证能够顺利执行。

 

错误2:The Process could not execute ‘sp_repcmd’ on ‘xxxx’

 

clipboard[3]

                                                       (图2)

报错的具体细节如下所示:

DESCRIPTION: Replication-Replication Transaction-Log Reader Subsystem: agent xxxxx failed. The process could not execute 'sp_replcmds' on 'xxxxxx'.

从网上查到的资料,只需修改数据库的Owner设置为sa即可解决,但是本质原因是啥?我没搞明白,后来查了一下资料:http://stackoverflow.com/questions/2723061/sql-server-2008-replication-failing-with-process-could-not-execute-sp-replcmds 显然不一定要修改数据库的Owner为sa也可。看来这应该是权限问题引起的。

clipboard[5]

                                           (图3) 

错误3:Replication-Replication Distribution Subsystem agent xxxxxxx failed. The process could not read file 'xxxxxxx' due to OS error 3.

 

clipboard[1]

                                                          (图4)

查看SQL SERVER日志文件,发现很多类似错误:

Date 6/28/2013 10:40:01 AM

Log SQL Server (Current - 6/28/2013 10:39:00 AM)

Source spid454

Message 

Replication-Replication Distribution Subsystem: agent xxxxxxxxxx failed. The process could not read file 'xxxxxxxxxxxxxxxxxx' due to OS error 3.

 Date 6/28/2013 10:40:01 AM

Log SQL Server (Current - 6/28/2013 10:39:00 AM)

 Source spid454

 Message

 Error: 14151, Severity: 18, State: 1.

 

产生这个错误的原因是因为使用请求订阅或远程分发服务器时,您必须指定一个 UNC 网络共享,例如 \\<computername>\snapshot,而不是为快照文件夹的本地路径。单击发布属性,查看Snapshot属性,发现快照文件位于G:\GEG_MESDB文件夹里,但是此时这里修改不了,只能去掉“Put files in the default folder"选项,勾选”Put Files in the following folder“选项,输入网络路径,即可解决上面这个错误。

clipboard[3]

 

参考资料:

http://www.sqlserverclub.com/essentialguides/how-to-install-sql-server-2005-replication.aspx

http://social.msdn.microsoft.com/Forums/sqlserver/en-US/64c041f5-3822-408f-b072-99feb18a5fcc/replication-components-are-not-installed

http://www.cnblogs.com/dudu/archive/2010/08/25/1808313.html

http://stackoverflow.com/questions/2723061/sql-server-2008-replication-failing-with-process-could-not-execute-sp-replcmds

http://www.sqlservercentral.com/blogs/sqlrepl/2011/11/30/the-process-could-not-read-file-due-to-os-error-3/

本站推荐文章:
本站热点文章:
顶一下
(0)
0%
踩一下
(1)
100%
------分隔线----------------------------
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色 情、暴力、反动的言论。
评价:
表情:
用户名:密码: 验证码:点击我更换图片