Skip to content

Commit

Permalink
Merge pull request #385 from BrentOzarULTD/dev
Browse files Browse the repository at this point in the history
Version 2016-07.
  • Loading branch information
BrentOzar authored Jul 15, 2016
2 parents 01e86f1 + 0b43694 commit 1c0bda6
Show file tree
Hide file tree
Showing 8 changed files with 1,195 additions and 731 deletions.
14 changes: 14 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# http://editorconfig.org
root = true

[*]
indent_style = tab
end_of_line = crlf
charset = utf-8
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
insert_final_newline = false
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ First of all, welcome! We're excited that you'd like to contribute. How would yo

Everyone here is expected to abide by the [Contributor Covenant Code of Conduct](#the-contributor-covenant-code-of-conduct).

Wanna do something else, or have a question not answered here? Hop into Slack and ask us questions before you get started. [Join SQLServer.slack.com](https://sql-server-slack.herokuapp.com/), and we're in the [#FirstResponderKit channel](https://sqlserver.slack.com/messages/firstresponderkit/). We welcome newcomers, and there's always a way you can help.
Wanna do something else, or have a question not answered here? Hop into Slack and ask us questions before you get started. [Get an invite to SQLCommunity.slack.com](https://sqlps.io/slack/), and we're in the [#FirstResponderKit channel](https://sqlcommunity.slack.com/messages/firstresponderkit/). We welcome newcomers, and there's always a way you can help.

## How to Report Bugs or Request Enhancements

Expand Down
1 change: 1 addition & 0 deletions Documentation/sp_Blitz Checks by Priority.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ If you want to change anything about a check - the priority, finding, URL, or ID
| 20 | Reliability | Databases in Unusual States | http://BrentOzar.com/go/repair | 102 |
| 20 | Reliability | Memory Dumps Have Occurred | http://BrentOzar.com/go/dump | 171 |
| 20 | Reliability | Plan Guides Failing | http://BrentOzar.com/go/guides | 164 |
| 20 | Reliability | Query Store Cleanup Disabled | http://BrentOzar.com/go/cleanup | 182 |
| 20 | Reliability | Unsupported Build of SQL Server | http://BrentOzar.com/go/unsupported | 128 |
| 20 | Reliability | User Databases on C Drive | http://BrentOzar.com/go/cdrive | 26 |
| 50 | Performance | Log File Growths Slow | http://BrentOzar.com/go/filegrowth | 151 |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ You're a DBA, sysadmin, or developer who manages Microsoft SQL Servers. It's you

To install, [download the latest release ZIP](https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/releases), then run the SQL files in the master database. (You can use other databases if you prefer.)

Only Microsoft-supported versions of SQL Server are supported here - sorry, 2005 and 2000. Some of these may work some of the time on 2005, but no promises, and don't file a support issue when they fail.
Only Microsoft-supported versions of SQL Server are supported here - sorry, 2005 and 2000. Some of these may work some of the time on 2005, but no promises, and don't file a support issue when they fail. (For example, we know the output tables won't work on SQL 2005 because one of the output fields is a DATETIMEOFFSET datatype, which isn't available in 2005.)

## How to Get Support

Everyone here is expected to abide by the [Contributor Covenant Code of Conduct](CONTRIBUTING.md#the-contributor-covenant-code-of-conduct).

Want to talk to the developers? [Join SQLServer.slack.com](https://sql-server-slack.herokuapp.com/), and we're in the [#FirstResponderKit channel](https://sqlserver.slack.com/messages/firstresponderkit/).
Want to talk to the developers? [Get an invite to SQLCommunity.slack.com](https://sqlps.io/slack/), and we're in the [#FirstResponderKit channel](https://sqlcommunity.slack.com/messages/firstresponderkit/).

Got a question? Ask it on [DBA.StackExchange.com](http://dba.stackexchange.com). Tag your question with the script name, like sp_Blitz, sp_BlitzCache, sp_BlitzIndex, etc, and we’ll be alerted of it right away.

Expand Down Expand Up @@ -53,7 +53,7 @@ In addition to the [parameters common to many of the stored procedures](#paramet
#### Writing sp_Blitz Output to a Table

```SQL
sp_Blitz @OutputDatabaseName = 'DBAtools', @OutputSchemaName = 'dbo', @OutputDatabaseName = 'BlitzResults';
sp_Blitz @OutputDatabaseName = 'DBAtools', @OutputSchemaName = 'dbo', @OutputTableName = 'BlitzResults';
```

Checks for the existence of a table DBAtools.dbo.BlitzResults, creates it if necessary, then adds the output of sp_Blitz into this table. This table is designed to support multiple outputs from multiple servers, so you can track your server's configuration history over time.
Expand Down
81 changes: 43 additions & 38 deletions sp_Blitz.sql
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ ALTER PROCEDURE [dbo].[sp_Blitz]
AS
SET NOCOUNT ON;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
SET @VersionDate = '20160626'
SET @VersionDate = '20160715'

IF @Help = 1 PRINT '
/*
Expand All @@ -53,6 +53,17 @@ AS
Unknown limitations of this version:
- None. (If we knew them, they would be known. Duh.)
Changes in v53.1 - 2016/07/15
- Warn about 2016 Query Store cleanup bug in Standard, Evaluation, Express:
https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/352
- Updating list of supported SQL Server versions:
https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/344
- Fixing bug in wait stats percentages:
https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/324
- For the full list of improvements and fixes in this version, see:
https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/milestone/3?closed=1
Changes in v53 - 2016/06/26
- BREAKING CHANGE: Standardized input & output parameters to be
consistent across the entire First Responder Kit. This also means the old
Expand All @@ -64,38 +75,6 @@ AS
when servers are in different data centers, different time zones. More info:
https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/288
Changes in v52 - 2016/06/02
- SQL Server 2016 compatibility. 2016 RTM ships with some questionable
database-level options like heaps in DWDiagnostics, target recovery
time changed in the DW* databases, and l_certSignSmDetach as a new
default sysadmin login, so ignoring those.
- If databases have an old compatibility level that does not support CTEs
then @CheckUserDatabaseObjects is set to 0 to avoid problems with
current checks. Get on the current compat level, Grandpa.
Changes in v51 - 2016/05/18
- Thomas Rushton added a check for dangerous third-party modules. (179)
More info: https://support.microsoft.com/en-us/kb/2033238
- New check for snapshot backups possibly freezing IO. Looking for 50GB+
backups that complete in under 60 seconds. (178)
- If there are 50+ user databases, you have to turn on @BringThePain = 1
in order to do @CheckUserDatabaseObjects = 1. (Speeds up sp_Blitz on
servers with hundreds or thousands of databases.)
- Reprioritized a bunch of checks, like moving security warnings down to
priority 230, so that you can use @IgnorePrioritiesAbove = 50 better.
- Bug fixes.
Changes in v50 - 2016/04/08
- Fixed bug in check ID 2 that would fail on a database with multiple log
files, that also has not had a backup in two weeks.
Changes in v49 - 2016/04/06
- Amazon RDS compatibility, but to do that, we have to skip a bunch of checks.
RDS does not allow you to query MSDB, configure TempDB, make
server-level sp_configure settings, etc.
For prior changes, see: http://www.BrentOzar.com/blitz/changelog/
Parameter explanations:
Expand Down Expand Up @@ -2686,9 +2665,9 @@ AS
BEGIN

IF (@ProductVersionMajor = 12 AND @ProductVersionMinor < 2000) OR
(@ProductVersionMajor = 11 AND @ProductVersionMinor <= 2100) OR
(@ProductVersionMajor = 10.5 AND @ProductVersionMinor <= 6000) OR
(@ProductVersionMajor = 10 AND @ProductVersionMinor <= 6000) OR
(@ProductVersionMajor = 11 AND @ProductVersionMinor < 3000) OR
(@ProductVersionMajor = 10.5 AND @ProductVersionMinor < 6000) OR
(@ProductVersionMajor = 10 AND @ProductVersionMinor < 6000) OR
(@ProductVersionMajor = 9 /*AND @ProductVersionMinor <= 5000*/)
BEGIN
INSERT INTO #BlitzResults(CheckID, Priority, FindingsGroup, Finding, URL, Details)
Expand Down Expand Up @@ -3614,6 +3593,32 @@ IF @ProductVersionMajor >= 10 AND @ProductVersionMinor >= 50
FROM [?].sys.database_query_store_options WHERE desired_state = 0 AND ''?'' NOT IN (''master'', ''model'', ''msdb'', ''tempdb'', ''DWConfiguration'', ''DWDiagnostics'', ''DWQueue'', ''ReportServer'', ''ReportServerTempDB'')';
END

IF NOT EXISTS ( SELECT 1
FROM #SkipChecks
WHERE DatabaseName IS NULL AND CheckID = 182 )
AND EXISTS(SELECT * FROM sys.all_objects WHERE name = 'database_query_store_options')
AND CAST(SERVERPROPERTY('edition') AS VARCHAR(100)) NOT LIKE '%Enterprise%'
AND CAST(SERVERPROPERTY('edition') AS VARCHAR(100)) NOT LIKE '%Developer%'
BEGIN
EXEC dbo.sp_MSforeachdb 'USE [?];
INSERT INTO #BlitzResults
(CheckID,
DatabaseName,
Priority,
FindingsGroup,
Finding,
URL,
Details)
SELECT TOP 1 182,
''?'',
20,
''Reliability'',
''Query Store Cleanup Disabled'',
''http://BrentOzar.com/go/cleanup'',
(''SQL 2016 RTM has a bug involving dumps that happen every time Query Store cleanup jobs run.'')
FROM [?].sys.database_query_store_options WHERE desired_state <> 0 AND ''?'' NOT IN (''master'', ''model'', ''msdb'', ''tempdb'', ''DWConfiguration'', ''DWDiagnostics'', ''DWQueue'', ''ReportServer'', ''ReportServerTempDB'')';
END


IF NOT EXISTS ( SELECT 1
FROM #SkipChecks
Expand Down Expand Up @@ -5509,10 +5514,10 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1
,'http://BrentOzar.com/go/waits' AS URL
, Details = CAST(CAST(SUM(os.wait_time_ms / 1000.0 / 60 / 60) OVER (PARTITION BY os.wait_type) AS NUMERIC(18,1)) AS NVARCHAR(20)) + N' hours of waits, ' +
CAST(CAST((SUM(60.0 * os.wait_time_ms) OVER (PARTITION BY os.wait_type) ) / @MSSinceStartup AS NUMERIC(18,1)) AS NVARCHAR(20)) + N' minutes average wait time per hour, ' +
CAST(CAST(
/* CAST(CAST(
100.* SUM(os.wait_time_ms) OVER (PARTITION BY os.wait_type)
/ (1. * SUM(os.wait_time_ms) OVER () )
AS NUMERIC(18,1)) AS NVARCHAR(40)) + N'% of waits, ' +
AS NUMERIC(18,1)) AS NVARCHAR(40)) + N'% of waits, ' + */
CAST(CAST(
100. * SUM(os.signal_wait_time_ms) OVER (PARTITION BY os.wait_type)
/ (1. * SUM(os.wait_time_ms) OVER ())
Expand Down
Loading

0 comments on commit 1c0bda6

Please sign in to comment.