Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Get your favorite SSC scripts directly in SSMS with the free SQL Scripts addin. Search for scripts directly from SSMS, and instantly access any saved scripts in your SSC briefcase from the favorites tab.
Download now (direct download link)

alert on blocking chains via email

By Wesley Brown,

This is a script I use to watch for blocking chains on a server there are four variables to be set. @Duration tells it how long to run. This will be an active thread for the duration. @IntervalSec how often to poll for blocking. @maxwaittime time in miliseconds a thread that is blocked that you wish to allert on 30000 is 30 seconds. If a thread has been blocked that long alerts will start going out. @recivers, people who get the emails.

You can set it up as a job to start it will always show as executing until the duration runs out. I have it set to run every minute just in case there is a thread exit it will restart the job again.

Total article views: 1648 | Views in the last 30 days: 3
 
Related Articles
BLOG

AG Worker Thread Blocked by Log Backup

We have an internal monitoring query that checks for system threads that are blocked. Recently, we r...

FORUM

blocking

blocking

FORUM

SQL Profiler - Can it tell you how long query was blocked for

I want to find only non-blocked long-duration queries

FORUM

max worker threads

max worker threads

FORUM

OLEDB Waiting and Blocking

OLEDB Waiting and Blocking

 
Contribute