Testing Alerts

Having set up system and performance alerting, it is now time to test those darn alerts to make sure they work! Alerting can notify a operator via email, paging, or a net send messages. Now adays, most people have a smart phone, not an old fashion pager. Therefore, I usually create a Active Directory group that has both the regular company email of the DBA group and their cell phone eqivalents which are usually the phone number @ provider name dot com.

Today, I am going to talk about two scripts that will help you test some of the alerts that you might choose to setup.

The first script create a stored procedure that takes a error level as a parameter. The code calls the RAISEEROR function to log a test error message to the windows application log and SQL server error log. These events will trigger off the ‘Alert For Severity Level 17’ alert we created in a earlier article.

The second script is used to trigger a the log file size SQL performance alert on the Adventure Works database. This script works by creating a simple table, inserting one row of data, and updating the row 20,000 times. This script is also handy when you want to shrink a log file and the active part is at the end of the file. Well, I will talk about that later, someday …

I usually do not endorse products; However, there is a ton of system stress test programs out there. The free one I chose to download is called CPU Speed Professional.

Armed with this utility, I wanted to see if my WMI alert would trigger when I ran the CPU load test several times. I have to confess there seems to be some type of lag between the WMI counter and SQL Server acting on a threshold that was exceeded. In short, I did get history count to increase on alert executions; However, more testing would be neccessary for this alert to be ready for prime time!

In conclusion, SQL Server out of the box gives you the tools to create alerts for both standard errors and performance issues. It is up to you to use these tools to build your own custom performance monitoring strategy. I STRONGLY suggest creating test scripts for each alert to that you can really trust they will be triggered when you need them.

Related posts

3 Thoughts to “Testing Alerts”

  1. I do trust all the ideas you have introduced in your post. They are really convincing and can definitely work. Nonetheless, the posts are too short for newbies. Could you please lengthen them a bit next time? Thanks for the post.

  2. Great post, you have pointed out some great details, I likewise conceive this is a very wonderful website.

  3. Doctor Who

    I went over this web site and I conceive you have a lot of excellent information, saved to bookmarks (:.

Leave a Comment