SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Capturing deadlock info


Capturing deadlock info

Author
Message
PearlJammer1
PearlJammer1
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1726 Visits: 1452
I am looking for advice on capturing deadlock info.
Can somebody please address the follwoing points :
1. Does enabling trace flags T1204 AND T1222 have any impact on server performance and do i need to restart the sql server service to do this as the boss has said this really isnt an option.
2. If i run profiler i understand it will have to be running at the time a deadlock occurs to capture info - what are the events i need to capture ? - Is there anyother way to capture the info - for example is a server side trace a better option ?
3.Any links to good advice on troubleshooting deadlocks would be appreciated.

Many thanks
Steve:-)
SQLmountain
SQLmountain
Say Hey Kid
Say Hey Kid (693 reputation)Say Hey Kid (693 reputation)Say Hey Kid (693 reputation)Say Hey Kid (693 reputation)Say Hey Kid (693 reputation)Say Hey Kid (693 reputation)Say Hey Kid (693 reputation)Say Hey Kid (693 reputation)

Group: General Forum Members
Points: 693 Visits: 782
Trace flag 1222 became available in SQL 2005, and is a lot easier to read than 1204.

You will want to run just trace flag 1222. Since there will be some overhead you can switch it on for with "DBCC TRACEON (1222, -1)", wait for the deadlock to reoccur - capturing information in the error log, and then switch it off . Alternatively, 1222 can be added as a startup parameter "-T1222", but this will require a restart.

SQL Profiler can capture the deadlock graph, but it does have to be running at the time of the deadlocking event. It is quite simple to configure. You can run a server side trace to limit the overhead.

Another alternative for troubleshooting deadlocks is to view the extended events deadlock graph. This is most likely already running and past deadlock events are available to you on your SQL Server.

Do a search on this site for any of the above topics. There are many articles on this site, and many helpful postings that will get you started troubleshooting deadlocks.

Bret
Orlando Colamatteo
Orlando Colamatteo
SSC-Forever
SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)SSC-Forever (41K reputation)

Group: General Forum Members
Points: 41566 Visits: 14413
If you go with a Trace flag you only need to enable one or the other. If I use them I'll pick 1222 because it offers a cleaner output. The overhead it adds is minimal so unless your server is under duress you will not need to worry about impacts from enabling it.

The WMI method in this article is worth implementing too. This article is a comprehensive walk through of all your options:

Handling Deadlocks in SQL Server

If you need help interpreting the deadlock information once captured post a new thread. There are many capable people on these forums that can assist.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Grant Fritchey
Grant Fritchey
SSC Guru
SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)SSC Guru (101K reputation)

Group: General Forum Members
Points: 101151 Visits: 33014
Since this is a post to a 2008 forum, you should know that you're already capturing deadlock information in the system_health extended events session that is running on your servers, right now. You no longer have to go the route of setting traceflags and digging through the error log. You can read about it in more detail here.

----------------------------------------------------
The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood...
Theodore Roosevelt

The Scary DBA
Author of: SQL Server Query Performance Tuning and SQL Server Execution Plans
Product Evangelist for Red Gate Software
PearlJammer1
PearlJammer1
SSCommitted
SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)SSCommitted (1.7K reputation)

Group: General Forum Members
Points: 1726 Visits: 1452
Thanks very much for this - I will defo check this out.
Look forward to hearing you speak at the sql in the city conf, London in June !!!
Thanks
Steve:-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search