MS SQL 2008 發佈訂閱配置錯誤總結

      最近在配置SQL 2008的發佈訂閱功能時,遇到了幾個小錯誤,順便概括總結一下(之後碰到各種關於發佈訂閱的錯誤都將收錄、更新到這篇文章),方便本身在之後碰到這類問題時,可以迅速解決問題。畢竟人的記憶能力有時效性,時間久了,有可能有些東西就模糊了或忘了,好記性不如爛筆頭。html

錯誤1:在數據庫服務器上新建本地發佈服務時報錯。sql

 

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也可,不過,這條命令我尚未試驗過。不保證可以順利執行。ide

 

錯誤2:The Process could not execute ‘sp_repcmd’ on ‘xxxx’sqlserver

 

clipboard[3]

                                                       (圖2)ui

報錯的具體細節以下所示:this

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

從網上查到的資料,只需修改數據庫的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]

 

錯誤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

clipboard[3]

文件夾權限問題,我用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/

相關文章
相關標籤/搜索