automating sql server daily health checks

14
Dean Willson presented to fwPASS on 10/22/2013 * Automating SQL Server Daily Health Checks

Upload: dean-willson

Post on 05-Dec-2014

1.414 views

Category:

Technology


1 download

DESCRIPTION

Presentation on using a PowerShell script to query a list of SQL Servers against the msdb databases for failed jobs and other exceptions for a daily email list of all the issues that occurred the previous day.

TRANSCRIPT

Page 1: Automating sql server daily health checks

Dean Willson presented to fwPASS on 10/22/2013

*Automating SQL Server Daily Health Checks

Page 2: Automating sql server daily health checks

*Why a Daily email?

*Peace of Mind

*Redundancy

*One place to see exceptions

*Notifications: on success, on fail, or both?

*40 success emails/day (full). Hundreds/day (log). Did I get them all?

Page 3: Automating sql server daily health checks

*What could I be missing?

*Deleted or missing Agent schedule

*Disabled agent job

*No mail profile (ex: restored user databases, but not master)

*Alert system not configured

*Job notification not configured

*Agent turned off

*Exchange was down

Page 4: Automating sql server daily health checks

*System Components

*Administrative utility database (or at least a table) to store the daily check results from each server

*Scheduling method to run jobs like backups, index rebuilds, consistency checks, etc.

*Text file list of SQL Servers/Instances to check

*Powershell script to query the servers

*Method to schedule the PoSH script (Scheduled Task)

*Reporting Services (Improved, but optional)

Page 5: Automating sql server daily health checks

*References

*http://ola.hallengren.com/

*http://www.brentozar.com/blitz/

Page 6: Automating sql server daily health checks

*Alert System not configured

Page 7: Automating sql server daily health checks

*Failed job – no notification

Page 8: Automating sql server daily health checks

*Desired Result

Page 9: Automating sql server daily health checks

*Email from within script

Page 10: Automating sql server daily health checks

*Set up Scheduled Task

Page 11: Automating sql server daily health checks

*Scheduled Task

Page 12: Automating sql server daily health checks
Page 13: Automating sql server daily health checks
Page 14: Automating sql server daily health checks

*Contact me

*Dean Willson

*Sr. Data Architect at Aunt Millie’s Bakeries

*fwPASS http://fwPASS.org

*[email protected]

*LinkedIn http://linkedin.com/in/deanwillson

*Twitter @deanwillson

*Blog http://dean-o.blogspot.com