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


Retrieving Deadlock Graphs with SQL Server 2008 Extended Events


Retrieving Deadlock Graphs with SQL Server 2008 Extended Events

Author
Message
Jonathan Kehayias
Jonathan Kehayias
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4427 Visits: 1816
Comments posted to this topic are about the item Retrieving Deadlock Graphs with SQL Server 2008 Extended Events

Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
ChiragNS
ChiragNS
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4855 Visits: 1865
nice article.

Is the deadlock info persisted after server/sql service restart.

"Keep Trying"
Jonathan Kehayias
Jonathan Kehayias
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4427 Visits: 1816
Great question. Unfortunately, the answer is no. Since the ring_buffer target is memory resident, it does not persist the information after restart. You can however, alter the system_health session and add a asyncronous_file_target to it which will log the information to a file on disk which will survive service restarts.

Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
icata
icata
Mr or Mrs. 500
Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)

Group: General Forum Members
Points: 518 Visits: 295
Can you alter the default system_health default session?



Jonathan Kehayias
Jonathan Kehayias
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4427 Visits: 1816
Jonathan Kehayias (2/23/2009)
You can however, alter the system_health session and add a asyncronous_file_target to it which will log the information to a file on disk which will survive service restarts.


As I covered in my first response, yes you can alter the default system_health session, though beyond adding a file target, I personally wouldn't change it, I would instead create a new session to handle whatever events I am interested in looking at. You can also drop it if you don't want it to exist at all. If you mess it up, you won't be capturing the information that the CSS team may want in troubleshooting a problem which may cause delays in your support case if they request that you recreate the system_health session from script.

The script that created this session is located in the InstallPath\Microsoft SQL Server\MSSQL10.MSSQLSERVER\MSSQL\Install folder in the u_tables.sql file. It is at the very bottom of the file. So if you do play with this session and screw it up, you can fix it by running the script from that file.

Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
icata
icata
Mr or Mrs. 500
Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)

Group: General Forum Members
Points: 518 Visits: 295
okay, thanks



rama.mathanmohan
rama.mathanmohan
SSC Rookie
SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)SSC Rookie (36 reputation)

Group: General Forum Members
Points: 36 Visits: 164
Hi,

you can use SQL Agent with WMI alert to capture and log deadlocks it works beautifully in SQL2005 and hope should work in SQL2008 see http://msdn.microsoft.com/en-us/library/ms186385.aspx for more details.

Rama Mathanmohan
Jonathan Kehayias
Jonathan Kehayias
SSCarpal Tunnel
SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)SSCarpal Tunnel (4.4K reputation)

Group: General Forum Members
Points: 4427 Visits: 1816
rama.mathanmohan (2/23/2009)
Hi,

you can use SQL Agent with WMI alert to capture and log deadlocks it works beautifully in SQL2005 and hope should work in SQL2008 see http://msdn.microsoft.com/en-us/library/ms186385.aspx for more details.

Rama Mathanmohan


WMI alerts are still there, but you have to turn them on, and they have a considerable cost when compared with Extended Events and the system_health session which is running by default. The cost to fire an event in Extended Events is 2 thousands of a millisecond (2us) which is insignificant when compared with the 2-3% CPU cost for the WMI deadlock monitor. The difference is that the event is buffered to the ring_buffer target asynchronously as the event fires instead of having to be read from the WMI Eventing and then processed by triggering a job. There is also consider problems with setting up WMI alerts in some environments for varying reasons. You can search the Administering forum on here and find a number of people having WMI namespace problems configuring the alerts like the following:

"The @wmi_query could not be executed in the @wmi_namespace provided. Verify that an event class selected in the query exists in the namespace and that the query has the correct syntax."

Extended Events are the future of troubleshooting SQL Server, so if you are on SQL Server 2008, I'd advise to utilize it over an older construct like WMI Alerts, Trace Flags, or Profiler Traces, all of which I have written about previously. They were all good methods of doing things in SQL 2005, but they don't compare to Extended Events in SQL 2008.

Jonathan Kehayias | Principal Consultant | MCM: SQL Server 2008
My Blog | Twitter | MVP Profile
Training | Consulting | Become a SQLskills Insider
Troubleshooting SQL Server: A Guide for Accidental DBAs
ChiragNS
ChiragNS
SSCarpal Tunnel
SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)SSCarpal Tunnel (4.9K reputation)

Group: General Forum Members
Points: 4855 Visits: 1865
Jonathan Kehayias (2/23/2009)
Great question. Unfortunately, the answer is no. Since the ring_buffer target is memory resident, it does not persist the information after restart. You can however, alter the system_health session and add a asyncronous_file_target to it which will log the information to a file on disk which will survive service restarts.


Thankyou

"Keep Trying"
icata
icata
Mr or Mrs. 500
Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)Mr or Mrs. 500 (518 reputation)

Group: General Forum Members
Points: 518 Visits: 295
I have and had quite a few issues with SQL Server integration with WMI especially with the Configuration Tools, so I am at the point that I think that regardless what might be the issues, the implementation of WMI is just unstable. To use WMI for anything would be a hard sale for me.



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