sp_Blitz – Free SQL Server Health Check Script
You’ve got a Microsoft SQL Server that somebody else built, or that other people have made changes to over the years, and you’re not exactly sure what kind of shape it’s in. Are there dangerous configuration settings that are causing slow performance or unreliability?
You want a fast, easy, free health check that flags common issues in seconds, and for each warning, gives you a link to a web page with more in-depth advice.
Download sp_Blitz and the First Responder Kit
If Microsoft supports it, so do we – unfortunately, that means SQL 2000 and 2005 are out of luck. We use a lot of cool DMVs and techniques that only work in current versions of SQL Server.
Common sp_Blitz Parameters
@CheckUserDatabaseObjects = 0 – turns off database checks like heaps and triggers. This makes sp_Blitz run way faster on systems with hundreds of databases.
@OutputServerName, @OutputDatabaseName, @OutputSchemaName, @OutputTableName – you can write sp_Blitz’s results to a central server for easier reporting, or just to a DBA utilities database on the same server.
@IgnorePrioritiesAbove = 50 – excludes lower-priority alarms like informational alerts. (You can use any priority level here.)
@Help = 1 – explains the rest of sp_Blitz’s parameters, plus the output columns as well.
How to Skip sp_Blitz Checks or Databases
Sometimes, you’re the honey badger, and you just don’t care. If you’d like to skip specific checks or databases, create a table like this:
USE DBAtools; GO CREATE TABLE dbo.BlitzChecksToSkip (ServerName NVARCHAR(128), DatabaseName NVARCHAR(128), CheckID INT); /* This example skips all checks on the server named Skippy: */ INSERT INTO dbo.BlitzChecksToSkip (ServerName, DatabaseName, CheckID) VALUES('Skippy', NULL, NULL); GO /* This example skips all checks on the database named HorribleDB: */ INSERT INTO dbo.BlitzChecksToSkip (ServerName, DatabaseName, CheckID) VALUES(NULL, 'HorribleDB', NULL); GO /* This example skips check #42 on all servers, all databases: */ INSERT INTO dbo.BlitzChecksToSkip (ServerName, DatabaseName, CheckID) VALUES(NULL, NULL, 42); GO
Then, you can run sp_Blitz and point it at that table to get the list of servers, databases, or checks to skip:
sp_Blitz @SkipChecksDatabase = 'DBAtools', @SkipChecksSchema = 'dbo', @SkipChecksTable = 'BlitzChecksToSkip';
If Bad Things Happen to Good Stored Procedures
If sp_BlitzFirst doesn’t compile or if it throws an error when it runs, head on over to DBA.StackExchange.com and post a question. Include the version of sp_BlitzFirst, your SQL Server version number (including the build #), and tag it with sp_BlitzFirst.
If you’d like to suggest changes or contribute code, visit the Github repository for the First Responder Kit. You can get more instructions, file issues, and read how to contribute to the community.
More Tools for Slow SQL Servers
sp_Blitz®: Free SQL Server Health Check – You’ve inherited a SQL Server from somebody, and you have no idea why it’s slow. sp_Blitz® gives you a prioritized list of health and performance issues, plus gives you URLs for more details about each issue.
Our Free 6-Month DBA Training Plan – Every Wednesday, you get an email with our favorite free SQL Server training resources. We start at backups and work our way up to performance tuning.
SQL Critical Care® – Don’t have time to learn the hard way? We’re here to help with our quick, easy process that gets to the root cause of your database health and performance pains.