Deadlocks

  • I am a learner. I want to test deadlock issue. I have code that create deadlock but how can we take the traces? Usually SQL server solve the deadlock issue by roll backing the transaction that take less resources but how can we solve deadlocks issues as a DBA instead of SQL Server. Give me all possible ways to monitor these dead locks.

  • One way to see the deadlocks in action is to run profiler against the database with the Deadlock graph, Lock:Deadlock Chain and Lock:Deadlock events selected. SQL Server will roll back one of the queries involved in the deadlock automatically and you can't manually do it. You can, however change the way the code works, tune performance etc to reduce the likelihood of them occuring.

  • The system_health extended events session that runs by default captures deadlocks. You can see the full deadlock graph there.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • Thank you

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

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