Tag: Blocking

  • Troubleshoot SQL Server Blocking, Step by Step

    Blocking isn’t a bug, it’s SQL Server enforcing correctness: one session holds a lock, another wants a conflicting one, and it has to wait. Most blocking resolves in milliseconds and nobody notices. The problem is blocking that doesn’t resolve fast, a query queued behind a session that’s holding a lock far longer than it should,…

  • Reading and Fixing a SQL Server Deadlock

    A deadlock is SQL Server refusing to let two sessions wait on each other forever. Session A holds a lock Session B needs, Session B holds a lock Session A needs, neither can proceed, so the deadlock monitor picks one as the victim, kills it with error 1205, and lets the other continue. That’s the…

  • DBA Scripts: Performance and Troubleshooting

    Part of the DBA-Tools Project. Four Ways of Answering “Why Is It Slow” “The database is slow” is rarely one problem. Sometimes it’s a query, a bad plan, a stale statistic. Sometimes it’s blocking, and the fix is completely different depending on which one it actually is. Sometimes the DMV snapshot has already missed the…

  • DBA Scripts: Collect Blocking and Deadlock Events

    Part of the DBA-Tools Project. Standing Watch for Blocking and Deadlocks, Not Just Checking When Asked Get Blocking Sessions and Get Deadlock Summary answer “what’s happening right now.” These two generators answer a different question: “what happened while nobody was looking.” Each creates a small recurring SQL Agent job that writes evidence into a DBAMonitor…