Deadlock debugging

  • Hi,

    I'm trying to track down a tricky wee deadlock.

    The application is web based and it emails me whenever any error occurs on the system.

    However I only find out about the process that was killed.

    I've used the trace commands that put deadlock info in the log file and I've used the SQL Profiler, but I have not managed to find out what the other process involved in the deadlock was doing and since being a busy system that user doesn't ever know they were involved in a deadlock they continue on with their tasks meaning that the last SQL on that process ID id way past the deadlock by the time I can see it.

    I'm probably doing something really silly, but if someone could advise me on how to find out what the other process was doing at the time of deadlock it would be much appreciated.

    Cheers,

    Dale

  • Hello Dale,

    Seen lately that with SQL Server 2005 it will be displayed graphically in a user friendly fashion.

    But having to work with 2000, have you tried with the profiler using those events:

     - Lock:Escalation

     - LockeadLock

     - LockeadLock Chain

    On my side, never used it.

    Regards,

    Carl

  • Ouups, instead of you should have seen:

     - Lock: Deadlock

    and

     - Lock: Deadlock Chain

  • Try using trace flags and then look into your error log. You can use -T1204 and -T3605 as startup parameter.

    If it is within a session, you can use DBCC Traceon(1204), DBCC traceon(3605). Give it a try.

     

    Give me a fish, you feed me for a day! Teach me to fish, you feed me for a life time.

  • you also need trace flag 1206 and probably 1205 as 1204 only gives part of the story.

    I believe these two trace flags are "undocumented"  so usual rules apply.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply