码迷,mamicode.com
首页 > 数据库 > 详细

sql server deadlock problem

时间:2018-12-25 20:07:17      阅读:209      评论:0      收藏:0      [点我收藏+]

标签:flags   sel   his   cap   lda   sql   ext   div   obj   

https://www.red-gate.com/simple-talk/sql/learn-sql-server/how-to-track-down-deadlocks-using-sql-server-2005-profiler/

 

https://social.msdn.microsoft.com/Forums/sqlserver/en-US/41a510cc-0e54-4bfb-92d2-12996abf99f6/help-needed-to-read-the-deadlock-graph?forum=sqldatabaseengine

Event: Proc [Database Id = 12 Object Id = 525453146] 

执行以下的sql语句,可以得到数据库名字和object名字

SELECT OBJECT_NAME(525453146) ,
DB_NAME(12);

 

 

https://www.cnblogs.com/rush/archive/2012/02/19/2358209.html

trace追踪的时候,选择deadlock:graph,deadlock:lock,deadlock:chain

 

https://blogs.msdn.microsoft.com/sqlserverfaq/2013/04/26/how-to-monitor-deadlock-using-extended-events-in-sql-server-2008-and-later/

Mentioned below are trace flags which are classical way to enable Deadlock trace in SQL Server Editions.

  1. Enable Trace Flag 1204 - Here data are captured in node level.

Dbcc traceon (T1204,-1)

  1. Enable Trace Flag 1222 - Here data is returned in XML Format. Also one can see the processes information also which are involved in deadlock.

DBCC Traceon (T1222,-1)

  1. Run SQL Profiler Trace to capture the Deadlock events.

This deadlock information can be viewed in SQL Server Error Logs and Trace Files.

DBCC TRACEON(1204, -1);
DBCC TRACEON(1222, -1);

 

 

 

sql server deadlock problem

标签:flags   sel   his   cap   lda   sql   ext   div   obj   

原文地址:https://www.cnblogs.com/chucklu/p/10175643.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!