亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

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

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

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

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

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

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

執(zhí)行 Transact-SQL 語句或批處理時(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' 的過程中出錯。調(diào)用 'sp_replcmds' 失敗,錯誤代碼: '18752',返回代碼: '1'。
已將數(shù)據(jù)庫上下文更改為 "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

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

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

說明

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

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

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

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

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

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

用戶操作

以下步驟可以幫助您解決這個問題。 如果任何一個步驟能正確啟動日志讀取器代理,則沒有必要完成剩余的步驟。

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

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

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

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

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

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

其實(shí)這里的解決方法也很簡單,就是執(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í)遇到錯誤18752的文章就介紹到這了,更多相關(guān)SQL Server錯誤18752內(nèi)容請搜索腳本之家以前的文章或繼續(xù)瀏覽下面的相關(guān)文章希望大家以后多多支持腳本之家!

相關(guān)文章

最新評論