Skip to content

Commit 250d980

Browse files
authored
Merge branch 'dev' into Branch-QSNotReadWrite
2 parents 71e4db5 + bcfea44 commit 250d980

File tree

4 files changed

+61
-9
lines changed

4 files changed

+61
-9
lines changed

Deprecated/readme.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
These old versions worked on SQL Server 2005.
1+
sp_AllNightLog, sp_AllNightLog_Setup, sp_BlitzInMemoryOLTP, and sp_BlitzQueryStore are no longer maintained. They may still work, but no guarantees. Please don't submit issues or pull requests to change them. You're welcome to fork the code and build your own supported version, of course, since they're open source.
22

3-
They are no longer maintained or updated.
4-
5-
Don't use 'em on SQL Server 2008 or newer - these are only for folks who still
6-
need to manage SQL Server 2005.
3+
The other files in this folder are older versions of the First Responder Kit that work with versions of Microsoft SQL Server that Microsoft themselves no longer support. If you're cursed enough to work with antiques like SQL Server 2012, 2008, or heaven forbid, 2005, you may still be able to get value out of these, but we don't support the scripts anymore either.

Documentation/sp_Blitz_Checks_by_Priority.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ If you want to change anything about a check - the priority, finding, URL, or ID
99
CURRENT HIGH CHECKID: 264.
1010
If you want to add a new one, start at 265.
1111

12+
1213
| Priority | FindingsGroup | Finding | URL | CheckID |
1314
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
1415
| 0 | Outdated sp_Blitz | sp_Blitz is Over 6 Months Old | https://www.BrentOzar.com/blitz/ | 155 |
@@ -247,6 +248,7 @@ If you want to add a new one, start at 265.
247248
| 200 | Performance | Non-Dynamic Memory | https://www.BrentOzar.com/go/memory | 190 |
248249
| 200 | Performance | Old Compatibility Level | https://www.BrentOzar.com/go/compatlevel | 62 |
249250
| 200 | Performance | Query Store Disabled | https://www.BrentOzar.com/go/querystore | 163 |
251+
| 200 | Performance | Query Store Wait Stats Disabled | https://www.sqlskills.com/blogs/erin/query-store-settings/ | 262 |
250252
| 200 | Performance | Query Store Effectively Disabled | https://learn.microsoft.com/en-us/sql/relational-databases/performance/best-practice-with-the-query-store#Verify | 263 |
251253
| 200 | Performance | Undesired Query Store State | https://learn.microsoft.com/en-us/sql/relational-databases/performance/best-practice-with-the-query-store#Verify | 264 |
252254
| 200 | Performance | Snapshot Backups Occurring | https://www.BrentOzar.com/go/snaps | 178 |

README.md

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Navigation
2525
- [sp_BlitzAnalysis: Query sp_BlitzFirst output tables](#sp_blitzanalysis-query-sp_BlitzFirst-output-tables)
2626
- Backups and Restores:
2727
- [sp_BlitzBackups: How Much Data Could You Lose](#sp_blitzbackups-how-much-data-could-you-lose)
28-
- [sp_AllNightLog: Back Up Faster to Lose Less Data](#sp_allnightlog-back-up-faster-to-lose-less-data)
2928
- [sp_DatabaseRestore: Easier Multi-File Restores](#sp_databaserestore-easier-multi-file-restores)
3029
- [Parameters Common to Many of the Stored Procedures](#parameters-common-to-many-of-the-stored-procedures)
3130
- [License MIT](#license)
@@ -42,7 +41,7 @@ To install, [download the latest release ZIP](https://github.com/BrentOzarULTD/S
4241
The First Responder Kit runs on:
4342

4443
* SQL Server on Windows - all versions that Microsoft supports. For end of support dates, check out the "Support Ends" column at https://sqlserverupdates.com.
45-
* SQL Server on Linux - yes, fully supported except sp_AllNightLog and sp_DatabaseRestore, which require xp_cmdshell, which Microsoft doesn't provide on Linux.
44+
* SQL Server on Linux - yes, fully supported except sp_DatabaseRestore, which require xp_cmdshell, which Microsoft doesn't provide on Linux.
4645
* Amazon RDS SQL Server - fully supported.
4746
* Azure SQL DB - not supported. Some of the procedures work, but some don't, and Microsoft has a tendency to change DMVs in Azure without warning, so we don't put any effort into supporting it. If it works, great! If not, any changes to make it work would be on you. [See the contributing.md file](CONTRIBUTING.md) for how to do that.
4847

@@ -275,7 +274,6 @@ sp_BlitzIndex focuses on mainstream index types. Other index types have varying
275274

276275
* Fully supported: rowstore indexes, columnstore indexes, temporal tables.
277276
* Columnstore indexes: fully supported. Key columns are shown as includes rather than keys since they're not in a specific order.
278-
* In-Memory OLTP (Hekaton): unsupported. These objects show up in the results, but for more info, you'll want to use sp_BlitzInMemoryOLTP instead.
279277
* Graph tables: unsupported. These objects show up in the results, but we don't do anything special with 'em, like call out that they're graph tables.
280278
* Spatial indexes: unsupported. We call out that they're spatial, but we don't do any special handling for them.
281279
* XML indexes: unsupported. These objects show up in the results, but we don't include the index's columns or sizes.

sp_Blitz.sql

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,7 @@ AS
155155
,@MinServerMemory bigint
156156
,@MaxServerMemory bigint
157157
,@ColumnStoreIndexesInUse bit
158+
,@QueryStoreInUse bit
158159
,@TraceFileIssue bit
159160
-- Flag for Windows OS to help with Linux support
160161
,@IsWindowsOperatingSystem BIT
@@ -6760,10 +6761,42 @@ IF @ProductVersionMajor >= 10
67606761

67616762
IF NOT EXISTS ( SELECT 1
67626763
FROM #SkipChecks
6763-
WHERE DatabaseName IS NULL AND CheckID = 263 )
6764+
WHERE DatabaseName IS NULL AND CheckID = 262 )
67646765
AND EXISTS(SELECT * FROM sys.all_objects WHERE name = 'database_query_store_options')
6766+
AND @ProductVersionMajor > 13 /* The relevant column only exists in 2017+ */
67656767
BEGIN
67666768

6769+
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 262) WITH NOWAIT;
6770+
6771+
EXEC dbo.sp_MSforeachdb 'USE [?];
6772+
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
6773+
INSERT INTO #BlitzResults
6774+
(CheckID,
6775+
DatabaseName,
6776+
Priority,
6777+
FindingsGroup,
6778+
Finding,
6779+
URL,
6780+
Details)
6781+
SELECT TOP 1 262,
6782+
N''?'',
6783+
200,
6784+
''Performance'',
6785+
''Query Store Wait Stats Disabled'',
6786+
''https://www.sqlskills.com/blogs/erin/query-store-settings/'',
6787+
(''The new SQL Server 2017 Query Store feature for tracking wait stats has not been enabled on this database. It is very useful for tracking wait stats at a query level.'')
6788+
FROM [?].sys.database_query_store_options
6789+
WHERE desired_state <> 0
6790+
AND wait_stats_capture_mode = 0
6791+
OPTION (RECOMPILE)';
6792+
END;
6793+
6794+
IF NOT EXISTS ( SELECT 1
6795+
FROM #SkipChecks
6796+
WHERE DatabaseName IS NULL AND CheckID = 263 )
6797+
AND EXISTS(SELECT * FROM sys.all_objects WHERE name = 'database_query_store_options')
6798+
BEGIN
6799+
67676800
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 263) WITH NOWAIT;
67686801

67696802
EXEC dbo.sp_MSforeachdb 'USE [?];
@@ -7648,6 +7681,20 @@ IF @ProductVersionMajor >= 10
76487681
IF EXISTS (SELECT * FROM #TemporaryDatabaseResults) SET @ColumnStoreIndexesInUse = 1;
76497682
END;
76507683

7684+
/* Check if Query Store is in use - for Github issue #3527 */
7685+
IF NOT EXISTS ( SELECT 1
7686+
FROM #SkipChecks
7687+
WHERE DatabaseName IS NULL AND CheckID = 74 ) /* Trace flags */
7688+
AND @ProductVersionMajor > 12 /* The relevant column only exists in versions that support Query store */
7689+
BEGIN
7690+
TRUNCATE TABLE #TemporaryDatabaseResults;
7691+
7692+
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 74) WITH NOWAIT;
7693+
7694+
EXEC dbo.sp_MSforeachdb 'USE [?]; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; IF EXISTS(SELECT * FROM sys.databases WHERE is_query_store_on = 1) INSERT INTO #TemporaryDatabaseResults (DatabaseName, Finding) VALUES (DB_NAME(), ''Yup'') OPTION (RECOMPILE);';
7695+
IF EXISTS (SELECT * FROM #TemporaryDatabaseResults) SET @QueryStoreInUse = 1;
7696+
END;
7697+
76517698
/* Non-Default Database Scoped Config - Github issue #598 */
76527699
IF EXISTS ( SELECT * FROM sys.all_objects WHERE [name] = 'database_scoped_configurations' )
76537700
BEGIN
@@ -8415,6 +8462,7 @@ IF @ProductVersionMajor >= 10
84158462
'Informational' AS FindingsGroup ,
84168463
'Trace Flag On' AS Finding ,
84178464
CASE WHEN [T].[TraceFlag] = '834' AND @ColumnStoreIndexesInUse = 1 THEN 'https://support.microsoft.com/en-us/kb/3210239'
8465+
WHEN [T].[TraceFlag] IN ('7745', '7752') THEN 'https://www.sqlskills.com/blogs/erin/query-store-trace-flags/'
84188466
ELSE'https://www.BrentOzar.com/go/traceflags/' END AS URL ,
84198467
'Trace flag ' +
84208468
CASE WHEN [T].[TraceFlag] = '652' THEN '652 enabled globally, which disables pre-fetching during index scans. This is usually a very bad idea.'
@@ -8433,6 +8481,13 @@ IF @ProductVersionMajor >= 10
84338481
WHEN [T].[TraceFlag] = '3226' THEN '3226 enabled globally, which keeps the event log clean by not reporting successful backups.'
84348482
WHEN [T].[TraceFlag] = '3505' THEN '3505 enabled globally, which disables Checkpoints. This is usually a very bad idea.'
84358483
WHEN [T].[TraceFlag] = '4199' THEN '4199 enabled globally, which enables non-default Query Optimizer fixes, changing query plans from the default behaviors.'
8484+
WHEN [T].[TraceFlag] = '7745' AND @ProductVersionMajor > 12 AND @QueryStoreInUse = 1 THEN '7745 enabled globally, which makes shutdowns/failovers quicker by not waiting for Query Store to flush to disk. This good idea loses you the non-flushed Query Store data.'
8485+
WHEN [T].[TraceFlag] = '7745' AND @ProductVersionMajor > 12 THEN '7745 enabled globally, which is for Query Store. None of your databases have Query Store enabled, so why do you have this turned on?'
8486+
WHEN [T].[TraceFlag] = '7745' AND @ProductVersionMajor <= 12 THEN '7745 enabled globally, which is for Query Store. Query Store does not exist on your SQL Server version, so why do you have this turned on?'
8487+
WHEN [T].[TraceFlag] = '7752' AND @ProductVersionMajor > 14 THEN '7752 enabled globally, which is for Query Store. However, it has no effect in your SQL Server version. Consider turning it off.'
8488+
WHEN [T].[TraceFlag] = '7752' AND @ProductVersionMajor > 12 AND @QueryStoreInUse = 1 THEN '7752 enabled globally, which stops queries needing to wait on Query Store loading up after database recovery.'
8489+
WHEN [T].[TraceFlag] = '7752' AND @ProductVersionMajor > 12 THEN '7752 enabled globally, which is for Query Store. None of your databases have Query Store enabled, so why do you have this turned on?'
8490+
WHEN [T].[TraceFlag] = '7752' AND @ProductVersionMajor <= 12 THEN '7752 enabled globally, which is for Query Store. Query Store does not exist on your SQL Server version, so why do you have this turned on?'
84368491
WHEN [T].[TraceFlag] = '8048' THEN '8048 enabled globally, which tries to reduce CMEMTHREAD waits on servers with a lot of logical processors.'
84378492
WHEN [T].[TraceFlag] = '8017' AND (CAST(SERVERPROPERTY('Edition') AS NVARCHAR(1000)) LIKE N'%Express%') THEN '8017 is enabled globally, but this is the default for Express Edition.'
84388493
WHEN [T].[TraceFlag] = '8017' AND (CAST(SERVERPROPERTY('Edition') AS NVARCHAR(1000)) NOT LIKE N'%Express%') THEN '8017 is enabled globally, which disables the creation of schedulers for all logical processors.'

0 commit comments

Comments
 (0)