Skip to content

Commit 4ae0011

Browse files
authored
Merge pull request BrentOzarULTD#353 from BrentOzarULTD/issue_352/brent
BrentOzarULTD#352 sp_Blitz warn about Query Store cleanup bug
2 parents 3b8f325 + a0ac549 commit 4ae0011

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

Documentation/sp_Blitz Checks by Priority.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ If you want to change anything about a check - the priority, finding, URL, or ID
3535
| 20 | Reliability | Databases in Unusual States | http://BrentOzar.com/go/repair | 102 |
3636
| 20 | Reliability | Memory Dumps Have Occurred | http://BrentOzar.com/go/dump | 171 |
3737
| 20 | Reliability | Plan Guides Failing | http://BrentOzar.com/go/guides | 164 |
38+
| 20 | Reliability | Query Store Cleanup Disabled | http://BrentOzar.com/go/cleanup | 182 |
3839
| 20 | Reliability | Unsupported Build of SQL Server | http://BrentOzar.com/go/unsupported | 128 |
3940
| 20 | Reliability | User Databases on C Drive | http://BrentOzar.com/go/cdrive | 26 |
4041
| 50 | Performance | Log File Growths Slow | http://BrentOzar.com/go/filegrowth | 151 |

sp_Blitz.sql

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3614,6 +3614,32 @@ IF @ProductVersionMajor >= 10 AND @ProductVersionMinor >= 50
36143614
FROM [?].sys.database_query_store_options WHERE desired_state = 0 AND ''?'' NOT IN (''master'', ''model'', ''msdb'', ''tempdb'', ''DWConfiguration'', ''DWDiagnostics'', ''DWQueue'', ''ReportServer'', ''ReportServerTempDB'')';
36153615
END
36163616

3617+
IF NOT EXISTS ( SELECT 1
3618+
FROM #SkipChecks
3619+
WHERE DatabaseName IS NULL AND CheckID = 182 )
3620+
AND EXISTS(SELECT * FROM sys.all_objects WHERE name = 'database_query_store_options')
3621+
AND CAST(SERVERPROPERTY('edition') AS VARCHAR(100)) NOT LIKE '%Enterprise%'
3622+
AND CAST(SERVERPROPERTY('edition') AS VARCHAR(100)) NOT LIKE '%Developer%'
3623+
BEGIN
3624+
EXEC dbo.sp_MSforeachdb 'USE [?];
3625+
INSERT INTO #BlitzResults
3626+
(CheckID,
3627+
DatabaseName,
3628+
Priority,
3629+
FindingsGroup,
3630+
Finding,
3631+
URL,
3632+
Details)
3633+
SELECT TOP 1 182,
3634+
''?'',
3635+
20,
3636+
''Reliability'',
3637+
''Query Store Cleanup Disabled'',
3638+
''http://BrentOzar.com/go/cleanup'',
3639+
(''SQL 2016 RTM has a bug involving dumps that happen every time Query Store cleanup jobs run.'')
3640+
FROM [?].sys.database_query_store_options WHERE desired_state <> 0 AND ''?'' NOT IN (''master'', ''model'', ''msdb'', ''tempdb'', ''DWConfiguration'', ''DWDiagnostics'', ''DWQueue'', ''ReportServer'', ''ReportServerTempDB'')';
3641+
END
3642+
36173643

36183644
IF NOT EXISTS ( SELECT 1
36193645
FROM #SkipChecks

0 commit comments

Comments
 (0)