Sign in with Microsoft
Sign in or create an account.
Hello,
Select a different account.
You have multiple accounts
Choose the account you want to sign in with.

徵兆

請試想下列案例:

  • 您可以使用 sp_cdc_cleanup_change_table管理 變更資料表清理程式。

  • 當系統被調用時, (CDC 中的變更資料) 與DC 清理之間會發生sp_cdc_cleanup_change_table問題。

在此案例,會發生下列錯誤 22852,嚴重性為 10 (資訊) 訊息:

無法刪除變更資料表專案,因為一或多個低水標記的變更而過時,以取得資料庫實例<資料庫名稱>。 執行 CommandName 命令<失敗> 。 錯誤<ErrorInfo>

使用動作和錯誤來判斷失敗的原因,然後重新提交要求。

附註因為這是資訊訊息,因此清理程式不會失敗,而且無法判斷清理是否成功。

修正程式詳細資料

若要判斷當您使用 sp_cdc_cleanup_change_table 時清理是否成功, (fCleanupFailed 位) 會新sp_cdc_cleanup_change_table函數。 這可以用來檢查任何捕獲實例的清理是否失敗。 如果 fCleanupFailed 輸出 為 0,則所有清理都成功。 如果為 1,至少一個捕獲實例的清理失敗。 以下是範例:

-- 先宣告變數並設定為零 

select @cleanup_failed_bit = 0

--Execute cleanup and obtain output bit

EXEC @retcode =sys.sp_cdc_cleanup_change_table

@capture_instance = '<CaptureInstance>',

@low_water_mark = @LSN,

@threshold = 1 ,

@fCleanupFailed = @cleanup_failed_bit output      

--Leverage @cleanup_failed_bit output to check the status.

解決方案

此問題已修正下列累積更新SQL Server:

每個新的累積更新SQL Server包含上一個建立中所有的修復程式和安全性修正程式。 我們建議您針對您的版本安裝最新SQL Server:

狀態

Microsoft 已確認<適用於>一節中所列的 Microsoft 產品確實有上述問題。

參考資料

瞭解 Microsoft 用來 描述軟體更新的術語。

Need more help?

Want more options?

探索訂閱權益、瀏覽訓練課程、瞭解如何保護您的裝置等等。

社群可協助您詢問並回答問題、提供意見反應,以及聆聽來自具有豐富知識的專家意見。

Was this information helpful?

How satisfied are you with the translation quality?
What affected your experience?
By pressing submit, your feedback will be used to improve Microsoft products and services. Your IT admin will be able to collect this data. Privacy Statement.

Thank you for your feedback!

×