Question

We are experiencing deadlocks on SQL Server 2014 and I am trying to capture as much information about them as I can.

There is already Extended Events Session that captures xml_deadlock_report events and I can see deadlock graph in SSMS.

Currently there are no trace flags enabled on this SQL Server. Will enabling flags 1204 and 1222 help to capture any additional information? It seems these flags don't apply to Extended Events but I am not 100% sure.

Was it helpful?

Solution

Adding Trace flag 1204 and 1222 will not help you to capture any additional information in SQL Server 2014 edition.

I also asked the question in twitter with #sqlhelp hashtag, if anybody can think of any reason to use trace flag over XE tracing. Answer I received, Extended event is superior to using Trace Flag. You should only use Trace Flag for legacy purpose.

OTHER TIPS

If you have the Deadlock Graph - you have quite a lot of information. Reading the deadlock graph takes a bit more skill. But not too much. The graph is showing you what a deadlock is. It's sort of like when two cars are at a point where they each need to cross a road to enter a parking lot across the street from them at the exact same spot. Say they each want to make a left turn. Car A can't take a left because Car B is in the way. Car B can't take a left because Car A is in the way.

SQL Server just blows one of the cars up for you instead of moving one of the cars a bit or driving around the other.

But I digress. The deadlock graph information and the rest of the info in the deadlock report will show you which object each session have locked and what type of lock - and also what lock the other wants.

You may see some query info, may not depending on a few things. But if you can recreate the situation you can capture some of the query info from an extended event session or a third party tool that watches queries coming in - tools like Sentry One, Idera DM or Solar Winds DPA should all show you queries as they happen - and most have a free trial period. Sentry even has their own deadlock graph, I trust the others do also but not sure.

Licensed under: CC-BY-SA with attribution
Not affiliated with dba.stackexchange
scroll top