Friday, March 23, 2012

Finding a Deadlock

Are there any type of utilities on SQL Enerprise manager that can help me
locate a deadlock?The two most useful utilities are DBCC TRACEON and SQL Profiler.
SQL Profiler has Lock:Deadlock & Lock:Deadlock Chain events which are useful
in interpreting deadlocks, but issuing the command: "DBCC TRACEON (3605,
1204, -1)" establishes a trace within SQL Server which writes detailed
deadlock debug info to the SQL Server Error Log.
SQL Profiler is a separate GUI tool from the EM, but can be launched from
the EM's tools menu. DBCC TRACEON is a command - you issue it from the Query
Analyser, but it writes output to the SQL Error Logs which can in turn be
read from the EM (under the Management node).
HTH
Regards,
Greg Linwood
SQL Server MVP
"MFRASER" <mfraser@.henwoodenergy.com> wrote in message
news:OKugdAm%23DHA.1844@.TK2MSFTNGP11.phx.gbl...
> Are there any type of utilities on SQL Enerprise manager that can help me
> locate a deadlock?
>|||Greg's advice is good. I would add, check out BOL for information about interpretting the output of trace flag 1204. The main thing is that it will identify the proc or SQL code which causes the deadlock and the resource that is deadlocked (row, page, key etc)
Cheers

No comments:

Post a Comment