rcamarda (robert.a.camarda@gmail.com) writes:
Quote:
Is there a table or structure that contains information that I can see
via the Activity Monitor? I've searched the msdb database and I've not
found any tables that have what I am looking for.
I have tools in Cognos BI that can monitor tables, see changes and
then send email. I want to monitor for blocked processes then react to
them.
We have SQL Server 2005.
|
You can detect blocking through sys.dm_os_waiting_tasks. For instance
you could poll it once a minute or so, and if wait_duration_ms exceeds
a certain threshold *and* session_id is >= 51 *and* there is a
blocking_session_id <session_id, you could send an alert or whatever.
You probably have to test to see that you don't get too many false alarms.
You may also be interested at looking at my beta_lockinfo,
http://www.sommarskog.se/sqlutil/beta_lockinfo.html.
--
Erland Sommarskog, SQL Server MVP,
esquel@sommarskog.se
Links for SQL Server Books Online:
SQL 2008:
http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005:
http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000:
http://www.microsoft.com/sql/prodinf...ons/books.mspx