Microsoft® SQL Server 2012 Unleashed
by Ray Rankins, Paul T. Bertucci, Chris Gallelli, Alex T. Silverstein
Deadlocks
Deadlocks are a common occurrence in database management systems (DMBSs). In simple terms, deadlocks occur when a process (for example, SPID 10) has a lock on a resource that another process (for example, SPID 20) wants. In addition, the second process (SPID 20) wants the resource that the first process has locked. This cyclic dependency causes the DBMS to kill one of the processes to resolve the deadlock situation.
Resolving deadlocks and identifying the deadlock participants can be difficult. In SQL Server 2012 and past versions, trace flag 1204 can be set to capture the processes involved in the deadlock. The output is text-based but provides valuable information about the types of locks and the statements that were executing at ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access