What is a Blocked Process, and Why Do I Care?

This is a question I received from a new SQL Server DBA so I thought it would make a great blog topic.  Blocking occurs in SQL Server when one process has one (or more) of the records locked and another process tries to acquire a lock on the record.  This will subsequently cause the process to wait until the original process is done so that it can acquire the record.  This can cause a domino effect if subsequent processes are waiting for the new process to be done with the records it is holding.  Blocking is somewhat different from the fatal deadlock which SQL Server handles and stops automatically (and a block can become a deadlock but this a different case). 

The blocked process essentially must wait and that can be a problem for your database!  I have previously blogged about best practices for separating our your log files to another drive as well as system databases and tempdb.  If you are not following these best practices, then they may play into your blocking situation as well as inadequate hardware for your SQL Server.

Ok, how do I see those blocked processes? 

One way is some code I found at CodeProject: List blocking processes in SQL server – CodeProject®.

Or, two days ago I wrote a blog talking about the newest release of Adam Machanic’s Who is Active stored procedure.

Below I have listed a couple of links for more information on how to use this procedure.

Adam Machanic : Why Am I Blocked? (A Month of Activity Monitoring, Part 19 of 30)

Adam Machanic : Blocking, Blockers, and Other B Words (A Month of Activity Monitoring, Part 14 of 30)

Adam Machanic : Leader of the Block (A Month of Activity Monitoring, Part 23 of 30)

Thanks, Adam!  Enjoy!

 

Advertisement

About SQLGator

Microsoft Data Platform MVP, Florida Gator, Star Wars fanatic and is there anything else...oh yeah PS4! I am a geek and SQL Server Business Intelligence Consultant, there are other technologies greater than these? Not so fast my friend! I also love to travel to new and exotic places.

Posted on March 29, 2012, in Maintenance and tagged . Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: