Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Automate alerts for database blockings. Expand / Collapse
Author
Message
Posted Sunday, September 02, 2012 8:30 PM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Today @ 3:42 AM
Points: 28, Visits: 153
Hi Everyone,

Just want to ask if anyone have "script" or jobs that will automatically check database blocking. I want to automate this kind of scenario and also create an email alert if there's database blocking.

This will be a big help to me.

Thanks in advance guys :)
Post #1353312
Posted Sunday, September 02, 2012 10:49 PM


SSC-Addicted

SSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-AddictedSSC-Addicted

Group: General Forum Members
Last Login: Today @ 5:39 AM
Points: 404, Visits: 627
marygrace_laurente23 (9/2/2012)
Hi Everyone,

Just want to ask if anyone have "script" or jobs that will automatically check database blocking. I want to automate this kind of scenario and also create an email alert if there's database blocking.

This will be a big help to me.

Thanks in advance guys :)


Did you try out something so far ?
Please let us know if have any issue in your approach.


--rhythmk
------------------------------------------------------------------
To post your question use below link

http://www.sqlservercentral.com/articles/Best+Practices/61537/
Post #1353332
Posted Sunday, September 02, 2012 11:15 PM


Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: Yesterday @ 5:42 PM
Points: 3,596, Visits: 5,112
Blocking is a pretty normal activity as the database establishes locks to allow some queries to complete before beginning others. I don't think you really want to get an email in those instances, because in a high volume application you'll get tons of emails!

SELECT * FROM sys.sysprocesses WHERE blocked <> 0


The above query identifies blocked processes. It would probably be better to dump all of them into a log table and then analyze them at periodic intervals.

This link may help: http://blogs.msdn.com/b/nikhilsi/archive/2008/07/13/how-to-identify-blocked-sql-processes-quickly.aspx



My mantra: No loops! No CURSORs! No RBAR! Hoo-uh!

My thought question: Have you ever been told that your query runs too fast?

My advice:
INDEXing a poor-performing query is like putting sugar on cat food. Yeah, it probably tastes better but are you sure you want to eat it?
The path of least resistance can be a slippery slope. Take care that fixing your fixes of fixes doesn't snowball and end up costing you more than fixing the root cause would have in the first place.


Need to UNPIVOT? Why not CROSS APPLY VALUES instead?
Since random numbers are too important to be left to chance, let's generate some!
Learn to understand recursive CTEs by example.
Splitting strings based on patterns can be fast!
Post #1353336
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse