Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions Documentation/sp_Blitz_Checks_by_Priority.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav

If you want to change anything about a check - the priority, finding, URL, or ID - open a Github issue first. The relevant scripts have to be updated too.

CURRENT HIGH CHECKID: 270.
If you want to add a new one, start at 271.
CURRENT HIGH CHECKID: 271.
If you want to add a new one, start at 272.

| Priority | FindingsGroup | Finding | URL | CheckID |
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
Expand Down Expand Up @@ -131,6 +131,7 @@ If you want to add a new one, start at 271.
| 170 | File Configuration | High VLF Count | https://www.BrentOzar.com/go/vlf | 69 |
| 170 | File Configuration | Multiple Log Files on One Drive | https://www.BrentOzar.com/go/manylogs | 41 |
| 170 | File Configuration | System Database on C Drive | https://www.BrentOzar.com/go/drivec | 24 |
| 170 | File Configuration | TempDB Governor Config Problem | https://www.BrentOzar.com/go/tempdbrg | 271 |
| 170 | File Configuration | TempDB Has >16 Data Files | https://www.BrentOzar.com/go/tempdb | 175 |
| 170 | File Configuration | TempDB Only Has 1 Data File | https://www.BrentOzar.com/go/tempdb | 40 |
| 170 | File Configuration | TempDB Unevenly Sized Data Files | https://www.BrentOzar.com/go/tempdb | 183 |
Expand Down
60 changes: 60 additions & 0 deletions sp_Blitz.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6752,6 +6752,66 @@ IF @ProductVersionMajor >= 10
END;



IF NOT EXISTS ( SELECT 1
FROM #SkipChecks
WHERE DatabaseName IS NULL AND CheckID = 271 )
AND EXISTS (SELECT * FROM sys.all_columns WHERE name = 'group_max_tempdb_data_percent')
AND EXISTS (SELECT * FROM sys.all_columns WHERE name = 'group_max_tempdb_data_mb')
BEGIN

IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 271) WITH NOWAIT;

IF EXISTS (SELECT * FROM sys.resource_governor_workload_groups
WHERE group_max_tempdb_data_percent <> 0
AND group_max_tempdb_data_mb IS NULL)
BEGIN
DECLARE @TempDBfiles TABLE (config VARCHAR(50), data_files INT)
/* Valid configs */
INSERT INTO @TempDBfiles
SELECT 'Fixed predictable growth' AS config, SUM(1) AS data_files
FROM master.sys.master_files
WHERE database_id = DB_ID('tempdb')
AND type = 0 /* data */
AND max_size <> -1 /* only limited ones */
AND growth <> 0 /* growth is set */
HAVING SUM(1) > 0
UNION ALL
SELECT 'Growth turned off' AS config, SUM(1) AS data_files
FROM master.sys.master_files
WHERE database_id = DB_ID('tempdb')
AND type = 0 /* data */
AND max_size = -1 /* unlimited */
AND growth = 0
HAVING SUM(1) > 0;

IF 1 <> (SELECT COUNT(*) FROM @TempDBfiles)
OR (SELECT SUM(data_files) FROM @TempDBfiles) <>
(SELECT SUM(1)
FROM master.sys.master_files
WHERE database_id = DB_ID('tempdb')
AND type = 0 /* data */)
BEGIN
INSERT INTO #BlitzResults
( CheckID ,
Priority ,
DatabaseName ,
FindingsGroup ,
Finding ,
URL ,
Details
)
SELECT 271 AS CheckID,
170 AS Priority,
'tempdb',
'File Configuration' AS FindingsGroup,
'TempDB Governor Config Problem' AS Finding,
'https://www.BrentOzar.com/go/tempdbrg' AS URL,
'Resource Governor is configured to cap TempDB usage by percent, but the TempDB file configuration will not allow that to take effect.' AS details
END
END
END

IF @CheckUserDatabaseObjects = 1
BEGIN

Expand Down
Loading