INF: Information on DBCC 1204 (Deadlock) Output

Last reviewed: April 28, 1997
Article ID: Q103855

The information in this article applies to:

  - Microsoft SQL Server version 4.2 for OS/2
  - Microsoft SQL Server version 4.2

SUMMARY

If a deadlock problem is encountered, it is often useful to use the DBCC 1204 trace flag to gather additional information. 1204 prints out the deadlock chains and victim.

MORE INFORMATION

An example of a 1204 output is below:

*** Deadlock detected - process 5 trying to wait on process 1 Deadlock chain --> LOCK REQUEST INITIATING DEADLOCK: LOGICAL: SH_PAGE at 0x1887551e

    lockid=6074 spid=5 dbid=6
Process 1 waiting on Process 5 for resource: LOGICAL. Lock requested by spid 1: SH_PAGE at 0x1867151e
    lockid=4301 spid=1 dbid=6

BLOCKED by spid 5 with the following lock: EX_PAGE Blocking at 0x256752c0
   lockid=4301 spid=5 dbid=6
   pstat=0x0100[ ]

  VICTIM: process 1;pstat 0x0100 [ ]; cputime=26
  VICTIM: process 5;pstat 0x0100 [ ]; cputime=8
    Process 5 was selected as victim
Your server command (process id #5) was deadlocked with another process and has been chosen as deadlock victim. Re-run your command. (Msg 1205, Level 13, State 1).
    Caller is deadlock victim (5: 0x0100)

We can extract the following information from this output:

  1. The spid and dbid numbers accurately reflect the spid and dbid involved.

  2. For a page lock, the lockid value is the logical page number in the database on which the deadlock occurred. This page number can be used to find the object on which the deadlock occurred. For a table lock, the lockid is the object id.

  3. The hex values for the lock pointers (SH_PAGE at 0x1887551e) are lock pointers. They are not of immediate value in debugging a deadlock problem.

  4. The deadlock victim is accurately reflected.

  5. The process with the least CPU time is selected as deadlock victim.


Additional query words:
Keywords : kbother SSrvLock SSrvServer SSrvWinNT
Version : 4.2 | 4.2 4.21 4.2a 4.2b
Platform : OS/2 Windows


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 28, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.