欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

SQL Server復(fù)制刪除發(fā)布時(shí)遇到錯(cuò)誤18752的問(wèn)題及解決方法

 更新時(shí)間:2024年01月26日 09:31:58   作者:瀟湘隱者  
朋友反饋他無(wú)法刪除一臺(tái)SQL Server數(shù)據(jù)庫(kù)上的發(fā)布,具體情況為刪除一個(gè)SQL Server Replication的發(fā)布時(shí),遇到這樣的錯(cuò)誤問(wèn)題如何解決呢,下面小編給大家分享SQL Server復(fù)制刪除發(fā)布時(shí)遇到錯(cuò)誤18752的問(wèn)題及解決方法,感興趣的朋友一起看看吧

朋友反饋他無(wú)法刪除一臺(tái)SQL Server數(shù)據(jù)庫(kù)上的發(fā)布,具體情況為刪除一個(gè)SQL Server Replication的發(fā)布時(shí),遇到下面錯(cuò)誤

TITLE: Microsoft SQL Server Management Studio
------------------------------

無(wú)法刪除發(fā)布“REPL_ITSMS”。

------------------------------
ADDITIONAL INFORMATION:

執(zhí)行 Transact-SQL 語(yǔ)句或批處理時(shí)發(fā)生了異常。 (Microsoft.SqlServer.ConnectionInfo)

------------------------------

Only one Log Reader Agent or log-related procedure (sp_repldone, sp_replcmds, and sp_replshowcmds) can connect to a database at a time. If you executed a log-related procedure, drop the connection with session ID 75 over which the procedure was executed or execute sp_replflush over that connection before starting the Log Reader Agent or executing another log-related procedure.
Only one Log Reader Agent or log-related procedure (sp_repldone, sp_replcmds, and sp_replshowcmds) can connect to a database at a time. If you executed a log-related procedure, drop the connection with session ID 75 over which the procedure was executed or execute sp_replflush over that connection before starting the Log Reader Agent or executing another log-related procedure.
Only one Log Reader Agent or log-related procedure (sp_repldone, sp_replcmds, and sp_replshowcmds) can connect to a database at a time. If you executed a log-related procedure, drop the connection with session ID 75 over which the procedure was executed or execute sp_replflush over that connection before starting the Log Reader Agent or executing another log-related procedure.
Only one Log Reader Agent or log-related procedure (sp_repldone, sp_replcmds, and sp_replshowcmds) can connect to a database at a time. If you executed a log-related procedure, drop the connection with session ID 75 over which the procedure was executed or execute sp_replflush over that connection before starting the Log Reader Agent or executing another log-related procedure.
Only one Log Reader Agent or log-related procedure (sp_repldone, sp_replcmds, and sp_replshowcmds) can connect to a database at a time. If you executed a log-related procedure, drop the connection with session ID 75 over which the procedure was executed or execute sp_replflush over that connection before starting the Log Reader Agent or executing another log-related procedure.
在執(zhí)行 'sp_droppublication' 的過(guò)程中出錯(cuò)。調(diào)用 'sp_replcmds' 失敗,錯(cuò)誤代碼: '18752',返回代碼: '1'。
已將數(shù)據(jù)庫(kù)上下文更改為 "itsms"。 (Microsoft SQL Server, Error: 18752)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft%20SQL%20Server&ProdVer=15.00.4312&EvtSrc=MSSQLServer&EvtID=18752&LinkId=20476

好久沒(méi)有維護(hù)SQL Server數(shù)據(jù)庫(kù)了,感覺(jué)生疏了很多,檢查后發(fā)現(xiàn)其實(shí)出現(xiàn)這個(gè)錯(cuò)誤,是因?yàn)橐淮沃荒苡幸粋€(gè)日志讀取器代理或日志相關(guān)過(guò)程(sp_repldone、sp_replcmds 和 sp_replshowcmds)連接到某個(gè)數(shù)據(jù)庫(kù)。 如果執(zhí)行了一個(gè)日志相關(guān)過(guò)程,那么在啟動(dòng)日志讀取器代理或者執(zhí)行另一個(gè)日志相關(guān)過(guò)程之前,請(qǐng)刪除執(zhí)行第一個(gè)過(guò)程時(shí)所用的連接,或者在該連接上執(zhí)行 sp_replflush。

其實(shí),官方文檔[1]關(guān)于錯(cuò)誤代碼18752有詳細(xì)的說(shuō)明,只要詳細(xì)閱讀文檔,就能知道如何解決這個(gè)錯(cuò)誤了。這里特此記錄一下。具體如下所示:

說(shuō)明

有多個(gè)當(dāng)前連接正在嘗試執(zhí)行以下任一日志相關(guān)過(guò)程: sp_repldone、 sp_replcmds或 sp_replshowcmds。 sp_repldone (Transact-SQL) 和 sp_replcmds (Transact-SQL) 存儲(chǔ)過(guò)程是日志讀取器代理用于查找和更新已發(fā)布數(shù)據(jù)庫(kù)中復(fù)制事務(wù)的相關(guān)信息的存儲(chǔ)過(guò)程。 sp_replshowcmds (Transact-SQL) 存儲(chǔ)過(guò)程用于排查某些類(lèi)型的事務(wù)復(fù)制問(wèn)題。

在以下情形下將引發(fā)此錯(cuò)誤:

  • 如果某個(gè)已發(fā)布數(shù)據(jù)庫(kù)的日志讀取器代理正在運(yùn)行,而另一個(gè)日志讀取器代理試圖在同一個(gè)數(shù)據(jù)庫(kù)上運(yùn)行,則對(duì)第二個(gè)代理引發(fā)此錯(cuò)誤,并且此錯(cuò)誤將出現(xiàn)在代理歷史記錄中。

  • 有時(shí)看起來(lái)像是有多個(gè)代理,則可能其中一個(gè)代理是執(zhí)行孤立進(jìn)程的結(jié)果。

  • 如果啟動(dòng)了已發(fā)布數(shù)據(jù)庫(kù)的日志讀取器代理,而用戶(hù)在同一個(gè)數(shù)據(jù)庫(kù)上執(zhí)行 sp_repldone、 sp_replcmds或 sp_replshowcmds ,則在執(zhí)行存儲(chǔ)過(guò)程的應(yīng)用程序(如 sqlcmd)中將引發(fā)此錯(cuò)誤。

  • 如果已發(fā)布數(shù)據(jù)庫(kù)的日志讀取器代理不在運(yùn)行狀態(tài),而用戶(hù)在執(zhí)行 sp_repldone、 sp_replcmds或 sp_replshowcmds 后沒(méi)有關(guān)閉用于執(zhí)行此過(guò)程的連接,則當(dāng)日志讀取器代理嘗試連接到數(shù)據(jù)庫(kù)時(shí)將引發(fā)此錯(cuò)誤。

用戶(hù)操作

以下步驟可以幫助您解決這個(gè)問(wèn)題。 如果任何一個(gè)步驟能正確啟動(dòng)日志讀取器代理,則沒(méi)有必要完成剩余的步驟。

  • 檢查日志讀取器代理的歷史記錄,查找可能導(dǎo)致此錯(cuò)誤的其他任何錯(cuò)誤。 有關(guān)在復(fù)制監(jiān)視器中查看代理狀態(tài)和錯(cuò)誤詳細(xì)資料的信息,請(qǐng)參閱使用復(fù)制監(jiān)視器查看信息和執(zhí)行任務(wù)。

  • 檢查 sp_who (Transact-SQL) 的輸出,了解連接到已發(fā)布數(shù)據(jù)庫(kù)的特定進(jìn)程標(biāo)識(shí)號(hào) (SPID) 。 關(guān)閉所有可能運(yùn)行 sp_repldone、 sp_replcmds或 sp_replshowcmds的連接。

  • 重新啟動(dòng)日志讀取器代理。 有關(guān)詳細(xì)信息,請(qǐng)參閱啟動(dòng)和停止復(fù)制代理 (SQL Server Management Studio).

  • 在分發(fā)服務(wù)器上重新啟動(dòng) SQL Server 代理服務(wù)(使之在群集中脫機(jī)或聯(lián)機(jī))。 如果計(jì)劃的作業(yè)有可能在任何其他 實(shí)例中執(zhí)行了sp_repldone 、 sp_replcmds 或 sp_replshowcmds SQL Server ,則也要為那些實(shí)例重新啟動(dòng) SQL Server 代理。 有關(guān)詳細(xì)信息,請(qǐng)參閱啟動(dòng)、停止或暫停 SQL Server 代理服務(wù)。

  • sp_replflush (發(fā)布服務(wù)器上對(duì)發(fā)布數(shù)據(jù)庫(kù)執(zhí)行 Transact-SQL) ,然后重啟日志讀取器代理。

  • 如果錯(cuò)誤繼續(xù)出現(xiàn),請(qǐng)?jiān)黾哟淼娜罩居涗洸⒅付ㄈ罩镜妮敵鑫募?此操作可能會(huì)提供找到該錯(cuò)誤和/或其他錯(cuò)誤消息的步驟,具體取決于錯(cuò)誤的上下文。

其實(shí)這里的解決方法也很簡(jiǎn)單,就是執(zhí)行命令sp_replflush后,就可以正常的刪除復(fù)制的發(fā)布了。

參考資料

[1]

1: https://learn.microsoft.com/zh-cn/sql/relational-databases/replication/mssql-eng018752?view=sql-server-ver16

到此這篇關(guān)于SQL Server復(fù)制刪除發(fā)布時(shí)遇到錯(cuò)誤18752的文章就介紹到這了,更多相關(guān)SQL Server錯(cuò)誤18752內(nèi)容請(qǐng)搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評(píng)論