DBCC TRACEON(1204,1222)
DBCC TRACEON (3604)
DBCC TRACEON (1204)
To turn off deadlock tracing and logging:
DBCC TRACEOFF (3604, 1204)
This will enable deadlock tracing for all existing connections and new. You can check out KB832524 for more details. 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.
Use SQL Profiler to trace deadlock events and get the resource ID of the table or index under contention. The steps to do this are:
- Start SQL profiler
- On the Trace Properties dialog box, on the General tab, check Save to file and specify a path to save the trace
- Click the Events tab, only add Locks\Lock:deadlock and Locks\Lock:deadlock chain
- Click the Data columns tab, add DatabaseID, IndexID, ObjectID
No comments:
Post a Comment