RSS Feed

Seven Jobs


June 14, 2012 by Mike Hillwig

No DBA Wants to be Caught with Her/His Pants Down

No DBA Wants to be Caught with Her/His Pants Down

In the next couple of months, I’m presenting a new session at least twice. “Seven SQL Agent Jobs You Should be Running” has been accepted for both SQL Saturday 126 in Indianapolis and SQL Saturday 158 in New York City. This is a new session for me, but I have a pretty clear idea of what I plan on presenting. I believe there are several jobs you should run on every instance just to make sure that your environment is behaving as expected. Here is the abstract I’ve submitted:

See those things around your ankles? You hope they’re your socks because no DBA wants to be caught with their pants down. Whether you’re an accidental DBA, a DBA who has just inherited a bunch of servers, or someone who works in a shop that won’t buy monitoring tools, this session will help you get basic monitoring in place to make sure you know what’s going on in your environment. You’ll learn how to implement seven simple scripts that perk their ears up and start barking like a dog after a stranger walks in the house. They are the canary in your coal mine. You’ll know when backups fail, when they run longer than usual, when data files are getting full, when transaction logs have excessive VLFs, and more.

My premise is that these jobs should run all the time and never actually do anything. But when they detect something that isn’t going as expected, they’ll poke up their head and let you know what’s happening. Here are the seven alerts for this session:

  • Database hasn’t done a full backup in the last X hours
  • Database in full recovery mode hasn’t done a transaction log backup in the last X hours
  • Database transaction log has excessive virtual log files
  • Database has no data file that can auto-grow, and none of these files has much free space left
  • Autoshrink enabled
  • Failed jobs in the last 24 hours
  • Jobs that are running more than x% over average

My target audience here really is junior DBAs and accidental DBAs. More experienced DBAs could write these themselves. Junior DBAs will walk away with a framework of how to implement these monitors in their own environment. And accidental DBAs will walk away with ready-to-run scripts that they can implement in their own environments.

As I’m developing this presentation, I thought I would throw this out to the other SQL bloggers for comment. What are the other “oh my god we’re going to die” types of alerts I should be monitoring?




  1. Mike,

    Here are a few. These can’t be run from an agent job without xp_cmdshell though:

    * Disk space on the volumes with SQL drives.
    * Databases created or deleted.
    * Database files in folders other than the expected ones
    * Index fragmentation beyojns X percent

  2. Great list! Two additional that come to mind are high severity error log messages (17+) and failed logins (maybe over x times in the last y minutes to filter out the inevitable fat fingered attempts?).

  3. […] you’ve seen my “Seven Jobs” presentation, this is a “see something, say something” situation. We’re […]

  4. I simply could not leave your website before suggesting that I extremely enjoyed the standard information a person provide to your visitors? Is gonna be back regularly to check up on new posts

  5. erjilopterin says:

    My spouse and i got absolutely fortunate Edward managed to deal with his survey while using the precious recommendations he got while using the weblog. It is now and again perplexing to just happen to be making a gift of steps which usually others might have been making money from. And we also figure out we’ve got the website owner to appreciate for that. The type of explanations you made, the simple blog navigation, the friendships your site make it possible to engender – it’s got most extraordinary, and it is making our son and us reckon that that article is enjoyable, and that’s incredibly vital. Many thanks for the whole lot!

  6. Say, you got a nice article.Really looking forward to read more. Awesome.

Leave a Reply

Your email address will not be published. Required fields are marked *