Welcome to SqlServer-QA.net Sign in | Join | Help

SQL Server Storage Engine & Tools (SSQA.net)

SQL Server Tools includes storage engine that includes a complete set of graphical tools and command prompt utilities that allow users, programmers, and administrators. SSMS, SSRS, SSIS & SSAS are most commonly used tools.
Deadlock not logged even though using relevant trace flag?

To my surprise a deadlock information is not logged on SQL Server log,  after a struggle for half-day I found that the startup parameters were messed up!

It may be usual practice by adopting  [; -T1204; -T1222 (with blank after semicolon)] that is what we applied and though the application generating deadlock information the error log is missing this entry. As this server needs to be online during the office-working hours I have adopted correct options by using [;-T1204;-T1222 (no blank after semicolon)] by restarting the SQL Server.

Just a notes about the deadlock information and handling them effectively,

When deadlocks occur, trace flag 1204 and trace flag 1222 return information that is captured in the SQL Server 2005 error log. Trace flag 1204 reports deadlock information formatted by each node involved in the deadlock. Trace flag 1222 formats deadlock information, first by processes and then by resources. It is possible to enable both trace flags to obtain two representations of the same deadlock event. 

I believe this Tip, TechnetUrl and KBA 926070 is much helpful to set the traceflags 1204 and 1222 and restartet sql server.

Also you can enable the trace flags with the -1 switch/parameter without needing to restart SQL Server (which is not ideal in production environments), you have to execute dbcc traceon (1204,1222,-1) which enables the trace flags for all (global) sql server sessions without the need to restart the service.

Also I have been referred to use third party tool called DeadLockDetector from lakesidesql, it can be downloaded from thislink. It performs lock/deadlock monitoring and logging for you and makes it extremely easy to identify culprits of problematic locks and deadlocks.

Posted: Sunday, August 05, 2007 9:12 AM by SQL Master

Comments

SSQA.net - SqlServer-QA.net said:

To my surprise a deadlock information is not logged on SQL Server log, after a struggle for half-day

# August 5, 2007 12:37 PM

Other SQL Server Blogs around the Web said:

To my surprise a deadlock information is not logged on SQL Server log, after a struggle for half-day

# August 6, 2007 9:53 PM
Anonymous comments are disabled