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.

徵狀

假設您使用的是 Microsoft SQL Server 2016 和2017。 如果您啟用事件xml_deadlock_report 收集鎖死資料,則會針對單一查詢內鎖死發生情況報告許多 xml_deadlock_report 事件。

因應措施

出於此問題的因應措施,您可以使用篩選 error_number = 1205 (而非 xml_deadlock_report) 來收集 error_reported XEvent,如下列範例所示:

在伺服器上建立事件會話 [Deadlock_Collection]

新增事件 sqlserver.error_reported (

WHERE ([error_number] = (1205)))

新增目標 package0 長條圖(將 filtering_event_name = N "sqlserver.lock_acquired",source = N "sqlserver.query_hash")

WITH (MAX_MEMORY = 4096 KB、EVENT_RETENTION_MODE = ALLOW_SINGLE_EVENT_LOSS、MAX_DISPATCH_LATENCY = 30 秒、MAX_EVENT_SIZE = 0 KB、MEMORY_PARTITION_MODE = NONE、TRACK_CAUSALITY = ON、STARTUP_STATE = OFF) 

經過

解決方案

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

       SQL Server 2017 累計更新10

       SQL Server 2016 SP2 累積更新2

使用此修正程式時,如果無法在不終止執行緒的情況下解決鎖死,就不會針對查詢內鎖死報告任何 xml_deadlock_report 事件。

每個新的 SQL Server 累計更新都包含所有的修正程式,以及前一個累積更新中所包含的所有安全性修正程式。 查看 SQL Server 的最新累計更新:

SQL Server 2017 的最新累計更新

SQL Server 2016 的最新累計更新

狀態

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!

×