Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase 12345»»»

Retrieving Deadlock Graphs with SQL Server 2008 Extended Events Expand / Collapse
Author
Message
Posted Friday, February 20, 2009 12:26 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, October 20, 2014 3:10 PM
Points: 1,683, Visits: 1,797
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
Post #661084
Posted Monday, February 23, 2009 3:44 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, September 23, 2014 8:08 AM
Points: 2,365, Visits: 1,846
nice article.

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





"Keep Trying"
Post #662447
Posted Monday, February 23, 2009 5:18 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, October 20, 2014 3:10 PM
Points: 1,683, Visits: 1,797
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
Post #662484
Posted Monday, February 23, 2009 9:52 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, August 14, 2014 9:45 PM
Points: 229, Visits: 276
Can you alter the default system_health default session?


Post #662737
Posted Monday, February 23, 2009 10:07 AM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, October 20, 2014 3:10 PM
Points: 1,683, Visits: 1,797
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
Post #662751
Posted Monday, February 23, 2009 11:57 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, August 14, 2014 9:45 PM
Points: 229, Visits: 276
okay, thanks


Post #662862
Posted Monday, February 23, 2009 4:14 PM
Grasshopper

GrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopperGrasshopper

Group: General Forum Members
Last Login: Tuesday, July 1, 2014 4:03 AM
Points: 10, Visits: 158
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
Post #663117
Posted Monday, February 23, 2009 4:27 PM


SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: Monday, October 20, 2014 3:10 PM
Points: 1,683, Visits: 1,797
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
Post #663121
Posted Monday, February 23, 2009 11:24 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, September 23, 2014 8:08 AM
Points: 2,365, Visits: 1,846
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"
Post #663229
Posted Tuesday, February 24, 2009 7:31 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, August 14, 2014 9:45 PM
Points: 229, Visits: 276
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.


Post #663478
« Prev Topic | Next Topic »

Add to briefcase 12345»»»

Permissions Expand / Collapse