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

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

 

                                                      (图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
------------------------------

 查看具体原因,是因为安装数据库实例时,没有选择安装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’

 

                                                       (图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也可。看来这应该是权限问题引起的。

                                           (图3) 

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

 

                                                          (图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“选项,输入网络路径,即可解决上面这个错误。

 

错误4:

Date 7/12/2013 1:20:38 PM

Log SQL Server (Current - 7/12/2013 1:10:00 PM)

Source spid326

Message

Replication-Replication Snapshot Subsystem: agent EGVNT02-MESDB-EGV_MESDB-1 failed. The replication agent had encountered an exception.

Source: Unknown

Exception Type: System.UnauthorizedAccessException

Exception Message: Access to the path '\\EGVNT02\EGV_MESDB_Replication\unc\EGVNT02_MESDB_EGV_MESDB\20130712132037\' is denied.

Messa

文件夹权限问题,我用NT 账号T1登录数据库,但是配置过程中用的是NT账号T2,共享文件夹没有授权给NT账号T2,所以报上面错误。

参考资料:

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/

最新文章

  1. Hibernate —— HQL、QBC检索方式
  2. Http和Socket连接区别
  3. mac 神奇时光机
  4. NYOJ 289 苹果(01背包)
  5. CloseableHttpClient 源码
  6. DNA序列局部比对(Smith–Waterman algorithm)
  7. Hibernate(八):基于外键映射的1-1关联关系
  8. Docker的Etcd项目
  9. UITableViewBase&amp;nbsp;UI_09
  10. 记录一次Orthanc dicom数据异常手动修复
  11. 为虚机Linux系统设置静态IP,ping通外网并解决相关问题
  12. Kali学习笔记33:Linux系统缓冲区溢出实验
  13. 「Android」 基于Binder通信的C/S架构体系认知
  14. Socket和ObjectOutputStream问题
  15. asp.net core处理中文的指南
  16. 重新设计导出API
  17. 『Argparse』命令行解析
  18. SQLServer&#160;学习笔记之超详细基础SQL语句&#160;Part&#160;7
  19. js包管理工具-- yarn
  20. 玩转树莓派:OpenHAB的入门(一)

热门文章

  1. ios如何在#import方面提升编译性能
  2. Oracle数据库备份、恢复及常见问题
  3. 1Z0-053 争议题目解析683
  4. 【Python实战】Pandas:让你像写SQL一样做数据分析(一)
  5. GO语言面向对象
  6. 利用Swashbuckle生成Web API Help Pages
  7. OA项目——总结
  8. 【C#进阶系列】23 程序集加载和反射
  9. 转载:《TypeScript 中文入门教程》 10、混入
  10. 第 31 章 项目实战-PC 端固定布局[3]