Skip to content

Commit 4ae548e

Browse files
Changed CheckID 183 TempDB Unevenly Sized Data Files to Percent Difference
Instead of a fixed 1GB difference I use a over default or passed in percent. I went with 10% as DDefault but do not mind that being changed.
1 parent 6a2a133 commit 4ae548e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sp_Blitz.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ALTER PROCEDURE [dbo].[sp_Blitz]
2727
@BringThePain TINYINT = 0 ,
2828
@UsualDBOwner sysname = NULL ,
2929
@UsualOwnerOfJobs sysname = NULL , -- This is to set the owner of Jobs is you have a different account than SA that you use as Default
30+
@MaxPercentTembdbFileVariation DECIMAL(3,2) = 0.10, -- set to a decent Default percent, I went with ten as a good start
3031
@SkipBlockingChecks TINYINT = 1 ,
3132
@Debug TINYINT = 0 ,
3233
@Version VARCHAR(30) = NULL OUTPUT,
@@ -3207,11 +3208,10 @@ AS
32073208

32083209
BEGIN
32093210

3210-
IF ( SELECT COUNT (distinct [size])
3211+
IF (SELECT (MAX((size * 8)) * 1.0)/(MIN((size * 8)) *1.0) - 1.0
32113212
FROM tempdb.sys.database_files
32123213
WHERE type_desc = 'ROWS'
3213-
HAVING MAX((size * 8) / (1024. * 1024)) - MIN((size * 8) / (1024. * 1024)) > 1.
3214-
) <> 1
3214+
) > @MaxPercentTembdbFileVariation
32153215
BEGIN
32163216

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

0 commit comments

Comments
 (0)