MS SQL 2008 发布订阅配置错误总结
????? 最近在配置SQL 2008的發(fā)布訂閱功能時,遇到了幾個小錯誤,順便歸納總結(jié)一下(以后碰到各類關(guān)于發(fā)布訂閱的錯誤都將收錄、更新到這篇文章),方便自己在以后碰到這類問題時,能夠迅速解決問題。畢竟人的記憶能力有時效性,時間久了,有可能有些東西就模糊了或忘了,好記性不如爛筆頭。
錯誤1:在數(shù)據(jù)庫服務(wù)器上新建本地發(fā)布服務(wù)時報錯。
?
????????????????????????????????????????????????????? (圖1)
報錯的具體細節(jié)如下所示:
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?查看具體原因,是因為安裝數(shù)據(jù)庫實例時,沒有選擇安裝Replication components,需要添加Replication components,首先找到安裝光盤或安裝鏡像文件,掛載到光驅(qū)或拷貝到某個文件目錄,例如,我這邊掛載后的安裝介質(zhì)位于Z盤,在運行里面輸入cmd命令,轉(zhuǎn)到Z盤,輸入下面命令:
setup.exe /q /Features=Replication /InstanceName=MSSQLSERVER /ACTION=INSTALL /IAcceptSQLServerLicenseTerms ,然后耐心等待安裝完成,從網(wǎng)上搜索的資料看,好像下面命令start /wait X:\Servers\setup.exe /qb INSTANCENAME=MSSQLSERVER ADDLOCAL=SQL_Replication也可,不過,這條命令我還沒有試驗過。不保證能夠順利執(zhí)行。
?
錯誤2:The Process could not execute ‘sp_repcmd’ on ‘xxxx’
?
?????????????????????????????????????????????????????? (圖2)
報錯的具體細節(jié)如下所示:
DESCRIPTION: Replication-Replication Transaction-Log Reader Subsystem: agent xxxxx failed. The process could not execute 'sp_replcmds' on 'xxxxxx'.
從網(wǎng)上查到的資料,只需修改數(shù)據(jù)庫的Owner設(shè)置為sa即可解決,但是本質(zhì)原因是啥?我沒搞明白,后來查了一下資料:http://stackoverflow.com/questions/2723061/sql-server-2008-replication-failing-with-process-could-not-execute-sp-replcmds?顯然不一定要修改數(shù)據(jù)庫的Owner為sa也可。看來這應(yīng)該是權(quán)限問題引起的。
????????????????????????????????????????? ?(圖3)?
錯誤3:Replication-Replication Distribution Subsystem agent xxxxxxx failed. The process could not read file 'xxxxxxx' due to OS error 3.
?
????????????????????????????????????????????????????????? (圖4)
查看SQL SERVER日志文件,發(fā)現(xiàn)很多類似錯誤:
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.
?
產(chǎn)生這個錯誤的原因是因為使用請求訂閱或遠程分發(fā)服務(wù)器時,您必須指定一個 UNC 網(wǎng)絡(luò)共享,例如 \\<computername>\snapshot,而不是為快照文件夾的本地路徑。單擊發(fā)布屬性,查看Snapshot屬性,發(fā)現(xiàn)快照文件位于G:\GEG_MESDB文件夾里,但是此時這里修改不了,只能去掉“Put files in the default folder"選項,勾選”Put Files in the following folder“選項,輸入網(wǎng)絡(luò)路徑,即可解決上面這個錯誤。
?
錯誤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
文件夾權(quán)限問題,我用NT 賬號T1登錄數(shù)據(jù)庫,但是配置過程中用的是NT賬號T2,共享文件夾沒有授權(quán)給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/
轉(zhuǎn)載于:https://www.cnblogs.com/kerrycode/p/3155799.html
總結(jié)
以上是生活随笔為你收集整理的MS SQL 2008 发布订阅配置错误总结的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: jQuery基本使用
- 下一篇: linux cmake编译源码,linu