|
Output format
|
Output is captured in the SQL Server 2005 error log.
|
Focused on the nodes involved in the deadlock. Each node has a dedicated section, and the final section describes the deadlock victim.
|
Returns information in an XML-like format that does not conform to an XML Schema Definition (XSD) schema. The format has three major sections. The first section declares the deadlock victim. The second section describes each process involved in the deadlock. The third section describes the resources that are synonymous with nodes in trace flag 1204.
|
|
Identifying attributes
|
SPID:<x> ECID:<x>. Identifies the system process ID thread in cases of parallel processes. The entry SPID:<x> ECID:0, where <x> is replaced by the SPID value, represents the main thread. The entry SPID:<x> ECID:<y>, where <x> is replaced by the SPID value and <y> is greater than 0, represents the sub-threads for the same SPID.
BatchID (sbid for trace flag 1222). Identifies the batch from which code execution is requesting or holding a lock. When Multiple Active Result Sets (MARS) is disabled, the BatchID value is 0. When MARS is enabled, the value for active batches is 1 to n. If there are no active batches in the session, BatchID is 0.
Mode. Specifies the type of lock for a particular resource that is requested, granted, or waited on by a thread. Mode can be IS (Intent Shared), S (Shared), U (Update), IX (Intent Exclusive), SIX (Shared with Intent Exclusive), and X (Exclusive). For more information, see Lock Modes.
Line # (line for trace flag 1222). Lists the line number in the current batch of statements that was being executed when the deadlock occurred.
Input Buf (inputbuf for trace flag 1222). Lists all the statements in the current batch.
|
Node. Represents the entry number in the deadlock chain.
Lists. The lock owner can be part of these lists:
-
Grant List. Enumerates the current owners of the resource.
-
Convert List. Enumerates the current owners that are trying to convert their locks to a higher level.
-
Wait List. Enumerates current new lock requests for the resource.
Statement Type. Describes the type of DML statement (SELECT, INSERT, UPDATE, or DELETE) on which the threads have permissions.
Victim Resource Owner. Specifies the participating thread that SQL Server chooses as the victim to break the deadlock cycle. The chosen thread and all existing sub-threads are terminated.
Next Branch. Represents the two or more sub-threads from the same SPID that are involved in the deadlock cycle.
|
deadlock victim. Represents the physical memory address of the task (see sys.dm_os_tasks (Transact-SQL)) that was selected as a deadlock victim. It may be 0 (zero) in the case of an unresolved deadlock. A task that is rolling back cannot be chosen as a deadlock victim.
executionstack. Represents Transact-SQL code that is being executed at the time the deadlock occurs.
priority. Represents deadlock priority. In certain cases, the Database Engine may opt to alter the deadlock priority for a short duration to achieve better concurrency.
logused. Log space used by the task.
owner id. The ID of the transaction that has control of the request.
status. State of the task. It is one of the following values:
-
pending. Waiting for a worker thread.
-
runnable. Ready to run but waiting for a quantum.
-
running. Currently running on the scheduler.
-
suspended. Execution is suspended.
-
done. Task has completed.
-
spinloop. Waiting for a spinlock to become free.
waitresource. The resource needed by the task.
waittime. Time in milliseconds waiting for the resource.
schedulerid. Scheduler associated with this task. See sys.dm_os_schedulers (Transact-SQL).
hostname. The name of the workstation.
isolationlevel. The current transaction isolation level.
Xactid. The ID of the transaction that has control of the request.
currentdb. The ID of the database.
lastbatchstarted. The last time a client process started batch execution.
lastbatchcompleted. The last time a client process completed batch execution.
clientoption1 and clientoption2. Set options on this client connection. This is a bitmask that includes information about options usually controlled by SET statements such as SET NOCOUNT and SET XACTABORT.
associatedObjectId. Represents the HoBT (heap or b-tree) ID.
|
|
Resource attributes
|
RID. Identifies the single row within a table on which a lock is held or requested. RID is represented as RID: db_id:file_id:page_no:row_no. For example, RID: 6:1:20789:0.
OBJECT. Identifies the table on which a lock is held or requested. OBJECT is represented as OBJECT: db_id:object_id. For example, TAB: 6:2009058193.
KEY. Identifies the key range within an index on which a lock is held or requested. KEY is represented as KEY: db_id:hobt_id (index key hash value). For example, KEY: 6:72057594057457664 (350007a4d329).
PAG. Identifies the page resource on which a lock is held or requested. PAG is represented as PAG: db_id:file_id:page_no. For example, PAG: 6:1:20789.
EXT. Identifies the extent structure. EXT is represented as EXT: db_id:file_id:extent_no. For example, EXT: 6:1:9.
DB. Identifies the database lock. DB is represented in one of the following ways:
-
DB: db_id
-
DB: db_id[BULK-OP-DB], which identifies the database lock taken by the backup database.
-
DB: db_id[BULK-OP-LOG], which identifies the lock taken by the backup log for that particular database.
APP. Identifies the lock taken by an application resource. APP is represented as APP: lock_resource. For example, APP: Formf370f478.
METADATA. Represents metadata resources involved in a deadlock. Because METADATA has many subresources, the value returned depends upon the subresource that has deadlocked. For example, METADATA.USER_TYPE returns user_type_id = <integer_value>. For more information about METADATA resources and subresources, see sys.dm_tran_locks (Transact-SQL).
HOBT. Represents a heap or b-tree involved in a deadlock.
|
None exclusive to this trace flag.
|
None exclusive to this trace flag.
|