Skip to content

Commit 027bdf6

Browse files
committed
sp_Blitz - Offline databases show up in auto-shrink and page verification checks BrentOzarULTD#2750
1 parent ba20c59 commit 027bdf6

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

‎sp_Blitz.sql‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1670,6 +1670,7 @@ AS
16701670
+ '] has auto-shrink enabled. This setting can dramatically decrease performance.' ) AS Details
16711671
FROM sys.databases
16721672
WHERE is_auto_shrink_on = 1
1673+
AND state <> 6 /* Offline */
16731674
AND name NOT IN ( SELECT DISTINCT
16741675
DatabaseName
16751676
FROM #SkipChecks
@@ -1703,7 +1704,7 @@ AS
17031704
FROM sys.databases
17041705
WHERE page_verify_option < 2
17051706
AND name <> ''tempdb''
1706-
AND state <> 1 /* Restoring */
1707+
AND state NOT IN (1, 6) /* Restoring, Offline */
17071708
and name not in (select distinct DatabaseName from #SkipChecks WHERE CheckID IS NULL OR CheckID = 14) OPTION (RECOMPILE);';
17081709

17091710
IF @Debug = 2 AND @StringToExecute IS NOT NULL PRINT @StringToExecute;

0 commit comments

Comments
 (0)