From cf35b974d1614049b86816da053bcda4f6d6ec82 Mon Sep 17 00:00:00 2001 From: Brent Ozar Date: Thu, 22 Feb 2024 06:55:01 -0800 Subject: [PATCH] 2024-02-22 release prep Bumping version numbers and dates. --- Install-All-Scripts.sql | 376 +++++++++++++++++------- Install-Core-Blitz-No-Query-Store.sql | 338 +++++++++++++++------ Install-Core-Blitz-With-Query-Store.sql | 340 +++++++++++++++------ sp_AllNightLog.sql | 2 +- sp_AllNightLog_Setup.sql | 2 +- sp_Blitz.sql | 2 +- sp_BlitzAnalysis.sql | 2 +- sp_BlitzBackups.sql | 2 +- sp_BlitzCache.sql | 2 +- sp_BlitzFirst.sql | 2 +- sp_BlitzInMemoryOLTP.sql | 2 +- sp_BlitzIndex.sql | 2 +- sp_BlitzLock.sql | 2 +- sp_BlitzQueryStore.sql | 2 +- sp_BlitzWho.sql | 2 +- sp_DatabaseRestore.sql | 2 +- sp_ineachdb.sql | 2 +- 17 files changed, 784 insertions(+), 298 deletions(-) diff --git a/Install-All-Scripts.sql b/Install-All-Scripts.sql index 547300b1..48ce8796 100644 --- a/Install-All-Scripts.sql +++ b/Install-All-Scripts.sql @@ -38,7 +38,7 @@ SET STATISTICS XML OFF; BEGIN; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -1375,7 +1375,7 @@ SET STATISTICS XML OFF; BEGIN; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -2900,7 +2900,7 @@ AS SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -3063,6 +3063,7 @@ AS ,@SkipModel bit = 0 ,@SkipTempDB bit = 0 ,@SkipValidateLogins bit = 0 + ,@SkipGetAlertInfo bit = 0 DECLARE @db_perms table @@ -3088,6 +3089,23 @@ AS /* End of declarations for First Responder Kit consistency check:*/ ; + /* Create temp table for check 73 */ + IF OBJECT_ID('tempdb..#AlertInfo') IS NOT NULL + EXEC sp_executesql N'DROP TABLE #AlertInfo;'; + + CREATE TABLE #AlertInfo + ( + FailSafeOperator NVARCHAR(255) , + NotificationMethod INT , + ForwardingServer NVARCHAR(255) , + ForwardingSeverity INT , + PagerToTemplate NVARCHAR(255) , + PagerCCTemplate NVARCHAR(255) , + PagerSubjectTemplate NVARCHAR(255) , + PagerSendSubjectOnly NVARCHAR(255) , + ForwardAlways INT + ); + /* Create temp table for check 2301 */ IF OBJECT_ID('tempdb..#InvalidLogins') IS NOT NULL EXEC sp_executesql N'DROP TABLE #InvalidLogins;'; @@ -3177,6 +3195,20 @@ AS END CATCH; END; /*Need execute on sp_validatelogins*/ + IF ISNULL(@SkipGetAlertInfo, 0) != 1 /*If @SkipGetAlertInfo hasn't been set to 1 by the caller*/ + BEGIN + BEGIN TRY + /* Try to fill the table for check 73 */ + INSERT INTO #AlertInfo + EXEC [master].[dbo].[sp_MSgetalertinfo] @includeaddresses = 0; + + SET @SkipGetAlertInfo = 0; /*We can execute sp_MSgetalertinfo*/ + END TRY + BEGIN CATCH + SET @SkipGetAlertInfo = 1; /*We have don't have execute rights or sp_MSgetalertinfo throws an error so skip it*/ + END CATCH; + END; /*Need execute on sp_MSgetalertinfo*/ + IF ISNULL(@SkipModel, 0) != 1 /*If @SkipModel hasn't been set to 1 by the caller*/ BEGIN IF EXISTS @@ -3489,7 +3521,7 @@ AS SELECT v.* FROM (VALUES(NULL, 211, NULL)) AS v (DatabaseName, CheckID, ServerName) /*xp_regread*/ - WHERE @SkipXPRegRead = 1; + WHERE @sa = 0; INSERT #SkipChecks (DatabaseName, CheckID, ServerName) SELECT @@ -3501,7 +3533,13 @@ AS SELECT v.* FROM (VALUES(NULL, 2301, NULL)) AS v (DatabaseName, CheckID, ServerName) /*sp_validatelogins*/ - WHERE @SkipValidateLogins = 1 + WHERE @SkipValidateLogins = 1; + + INSERT #SkipChecks (DatabaseName, CheckID, ServerName) + SELECT + v.* + FROM (VALUES(NULL, 73, NULL)) AS v (DatabaseName, CheckID, ServerName) /*sp_validatelogins*/ + WHERE @SkipGetAlertInfo = 1; IF @sa = 0 BEGIN @@ -3702,6 +3740,8 @@ AS INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'model'); /* Max file size set */ INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'msdb'); /* Max file size set */ INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'tempdb'); /* Max file size set */ + INSERT INTO #SkipChecks (CheckID) VALUES (224); /* CheckID 224 - Performance - SSRS/SSAS/SSIS Installed */ + INSERT INTO #SkipChecks (CheckID) VALUES (92); /* CheckID 92 - drive space */ INSERT INTO #BlitzResults ( CheckID , Priority , @@ -4022,7 +4062,7 @@ AS IF @BringThePain = 0 AND 50 <= (SELECT COUNT(*) FROM sys.databases) AND @CheckUserDatabaseObjects = 1 BEGIN SET @CheckUserDatabaseObjects = 0; - PRINT 'Running sp_Blitz @CheckUserDatabaseObjects = 1 on a server with 50+ databases may cause temporary insanity for the server and/or user.'; + PRINT 'Running sp_Blitz @CheckUserDatabaseObjects = 1 on a server with 50+ databases may cause temporary problems for the server and/or user.'; PRINT 'If you''re sure you want to do this, run again with the parameter @BringThePain = 1.'; INSERT INTO #BlitzResults ( CheckID , @@ -6256,23 +6296,6 @@ AS IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 53) WITH NOWAIT; - --INSERT INTO #BlitzResults - -- ( CheckID , - -- Priority , - -- FindingsGroup , - -- Finding , - -- URL , - -- Details - -- ) - -- SELECT TOP 1 - -- 53 AS CheckID , - -- 200 AS Priority , - -- 'Informational' AS FindingsGroup , - -- 'Cluster Node' AS Finding , - -- 'https://BrentOzar.com/go/node' AS URL , - -- 'This is a node in a cluster.' AS Details - -- FROM sys.dm_os_cluster_nodes; - DECLARE @AOFCI AS INT, @AOAG AS INT, @HAType AS VARCHAR(10), @errmsg AS VARCHAR(200) SELECT @AOAG = CAST(SERVERPROPERTY('IsHadrEnabled') AS INT) @@ -6303,7 +6326,7 @@ AS Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node' AS Finding , @@ -6320,7 +6343,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -6346,7 +6369,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -6371,7 +6394,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -7682,6 +7705,10 @@ AS FROM sys.all_columns WHERE name = 'is_memory_optimized_elevate_to_snapshot_on' AND object_id = OBJECT_ID('sys.databases') AND SERVERPROPERTY('EngineEdition') <> 8; /* Hekaton is always enabled in Managed Instances per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */ + INSERT INTO #DatabaseDefaults + SELECT 'is_accelerated_database_recovery_on', 0, 145, 210, 'Acclerated Database Recovery Enabled', 'https://www.brentozar.com/go/dbdefaults', NULL + FROM sys.all_columns + WHERE name = 'is_accelerated_database_recovery_on' AND object_id = OBJECT_ID('sys.databases') AND SERVERPROPERTY('EngineEdition') NOT IN (5, 8) ; DECLARE DatabaseDefaultsLoop CURSOR FOR SELECT name, DefaultValue, CheckID, Priority, Finding, URL, Details @@ -11073,20 +11100,6 @@ IF @ProductVersionMajor >= 10 IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 73) WITH NOWAIT; - DECLARE @AlertInfo TABLE - ( - FailSafeOperator NVARCHAR(255) , - NotificationMethod INT , - ForwardingServer NVARCHAR(255) , - ForwardingSeverity INT , - PagerToTemplate NVARCHAR(255) , - PagerCCTemplate NVARCHAR(255) , - PagerSubjectTemplate NVARCHAR(255) , - PagerSendSubjectOnly NVARCHAR(255) , - ForwardAlways INT - ); - INSERT INTO @AlertInfo - EXEC [master].[dbo].[sp_MSgetalertinfo] @includeaddresses = 0; INSERT INTO #BlitzResults ( CheckID , Priority , @@ -11101,7 +11114,7 @@ IF @ProductVersionMajor >= 10 'No Failsafe Operator Configured' AS Finding , 'https://www.brentozar.com/go/failsafe' AS URL , ( 'No failsafe operator is configured on this server. This is a good idea just in-case there are issues with the [msdb] database that prevents alerting.' ) AS Details - FROM @AlertInfo + FROM #AlertInfo WHERE FailSafeOperator IS NULL; END; @@ -12908,6 +12921,11 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1 EXEC sp_executesql N'DROP TABLE #InvalidLogins;'; END; + IF OBJECT_ID('tempdb..#AlertInfo') IS NOT NULL + BEGIN + EXEC sp_executesql N'DROP TABLE #AlertInfo;'; + END; + /* Reset the Nmumeric_RoundAbort session state back to enabled if it was disabled earlier. See Github issue #2302 for more info. @@ -12967,7 +12985,7 @@ AS SET NOCOUNT ON; SET STATISTICS XML OFF; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -13845,7 +13863,7 @@ AS SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -15627,7 +15645,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -15814,7 +15832,7 @@ IF @Help = 1 UNION ALL SELECT N'@MinutesBack', N'INT', - N'How many minutes back to begin plan cache analysis. If you put in a positive number, we''ll flip it to negtive.'; + N'How many minutes back to begin plan cache analysis. If you put in a positive number, we''ll flip it to negative.'; /* Column definitions */ @@ -22986,7 +23004,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -23015,7 +23033,7 @@ Known limitations of this version: filegroup/partition scheme etc.) -- (The compression and filegroup index create syntax is not trivial because it is set at the partition level and is not trivial to code.) - - Does not advise you about data modeling for clustered indexes and primary keys (primarily looks for signs of insanity.) + - Does not advise you about data modeling for clustered indexes and primary keys (primarily looks for signs of problems.) Unknown limitations of this version: - We knew them once, but we forgot. @@ -23191,9 +23209,14 @@ IF OBJECT_ID('tempdb..#CheckConstraints') IS NOT NULL IF OBJECT_ID('tempdb..#FilteredIndexes') IS NOT NULL DROP TABLE #FilteredIndexes; - + IF OBJECT_ID('tempdb..#Ignore_Databases') IS NOT NULL DROP TABLE #Ignore_Databases + +IF OBJECT_ID('tempdb..#dm_db_partition_stats_etc') IS NOT NULL + DROP TABLE #dm_db_partition_stats_etc +IF OBJECT_ID('tempdb..#dm_db_index_operational_stats') IS NOT NULL + DROP TABLE #dm_db_index_operational_stats RAISERROR (N'Create temp tables.',0,1) WITH NOWAIT; CREATE TABLE #BlitzIndexResults @@ -23857,7 +23880,7 @@ BEGIN TRY VALUES ( 1, 0, N'You''re trying to run sp_BlitzIndex on a server with ' + CAST(@NumDatabases AS NVARCHAR(8)) + N' databases. ', - N'Running sp_BlitzIndex on a server with 50+ databases may cause temporary insanity for the server and/or user.', + N'Running sp_BlitzIndex on a server with 50+ databases may cause temporary problems for the server and/or user.', N'If you''re sure you want to do this, run again with the parameter @BringThePain = 1.', 'http://FirstResponderKit.org', '', @@ -23884,7 +23907,7 @@ BEGIN TRY bir.create_tsql, bir.more_info FROM #BlitzIndexResults AS bir; - RAISERROR('Running sp_BlitzIndex on a server with 50+ databases may cause temporary insanity for the server', 12, 1); + RAISERROR('Running sp_BlitzIndex on a server with 50+ databases may cause temporary problems for the server', 12, 1); END; RETURN; @@ -24003,6 +24026,8 @@ FROM sys.databases ---------------------------------------- BEGIN TRY BEGIN + DECLARE @d VARCHAR(19) = CONVERT(VARCHAR(19), GETDATE(), 121); + RAISERROR (N'starting at %s',0,1, @d) WITH NOWAIT; --Validate SQL Server Version @@ -24373,47 +24398,79 @@ BEGIN TRY --NOTE: If you want to use the newer syntax for 2012+, you'll have to change 2147483647 to 11 on line ~819 --This change was made because on a table with lots of paritions, the OUTER APPLY was crazy slow. - SET @dsql = N'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; + + -- get relevant columns from sys.dm_db_partition_stats, sys.partitions and sys.objects + DROP TABLE if exists #dm_db_partition_stats_etc + create table #dm_db_partition_stats_etc + ( + database_id smallint not null + , object_id int not null + , sname sysname NULL + , index_id int + , partition_number int + , partition_id bigint + , row_count bigint + , reserved_MB bigint + , reserved_LOB_MB bigint + , reserved_row_overflow_MB bigint + , lock_escalation_desc nvarchar(60) + , data_compression_desc nvarchar(60) + ) + + -- get relevant info from sys.dm_db_index_operational_stats + drop TABLE if exists #dm_db_index_operational_stats + create table #dm_db_index_operational_stats + ( + database_id smallint not null + , object_id int not null + , index_id int + , partition_number int + , hobt_id bigint + , leaf_insert_count bigint + , leaf_delete_count bigint + , leaf_update_count bigint + , range_scan_count bigint + , singleton_lookup_count bigint + , forwarded_fetch_count bigint + , lob_fetch_in_pages bigint + , lob_fetch_in_bytes bigint + , row_overflow_fetch_in_pages bigint + , row_overflow_fetch_in_bytes bigint + , row_lock_count bigint + , row_lock_wait_count bigint + , row_lock_wait_in_ms bigint + , page_lock_count bigint + , page_lock_wait_count bigint + , page_lock_wait_in_ms bigint + , index_lock_promotion_attempt_count bigint + , index_lock_promotion_count bigint + , page_latch_wait_count bigint + , page_latch_wait_in_ms bigint + , page_io_latch_wait_count bigint + , page_io_latch_wait_in_ms bigint + ) + + SET @dsql = N' + DECLARE @d VARCHAR(19) = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''start getting data into #dm_db_partition_stats_etc at %s'',0,1, @d) WITH NOWAIT; + SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; + INSERT INTO #dm_db_partition_stats_etc + ( + database_id, object_id, sname, index_id, partition_number, partition_id, row_count, reserved_MB, reserved_LOB_MB, reserved_row_overflow_MB, lock_escalation_desc, data_compression_desc + ) SELECT ' + CAST(@DatabaseID AS NVARCHAR(10)) + N' AS database_id, ps.object_id, - s.name, + s.name as sname, ps.index_id, ps.partition_number, + ps.partition_id, ps.row_count, ps.reserved_page_count * 8. / 1024. AS reserved_MB, ps.lob_reserved_page_count * 8. / 1024. AS reserved_LOB_MB, ps.row_overflow_reserved_page_count * 8. / 1024. AS reserved_row_overflow_MB, le.lock_escalation_desc, - ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N', - SUM(os.leaf_insert_count), - SUM(os.leaf_delete_count), - SUM(os.leaf_update_count), - SUM(os.range_scan_count), - SUM(os.singleton_lookup_count), - SUM(os.forwarded_fetch_count), - SUM(os.lob_fetch_in_pages), - SUM(os.lob_fetch_in_bytes), - SUM(os.row_overflow_fetch_in_pages), - SUM(os.row_overflow_fetch_in_bytes), - SUM(os.row_lock_count), - SUM(os.row_lock_wait_count), - SUM(os.row_lock_wait_in_ms), - SUM(os.page_lock_count), - SUM(os.page_lock_wait_count), - SUM(os.page_lock_wait_in_ms), - SUM(os.index_lock_promotion_attempt_count), - SUM(os.index_lock_promotion_count), - SUM(os.page_latch_wait_count), - SUM(os.page_latch_wait_in_ms), - SUM(os.page_io_latch_wait_count), - SUM(os.page_io_latch_wait_in_ms), '; - - /* Get columnstore dictionary size - more info: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2585 */ - IF EXISTS (SELECT * FROM sys.all_objects WHERE name = 'column_store_dictionaries') - SET @dsql = @dsql + N' COALESCE((SELECT SUM (on_disk_size / 1024.0 / 1024) FROM ' + QUOTENAME(@DatabaseName) + N'.sys.column_store_dictionaries dict WHERE dict.partition_id = ps.partition_id),0) AS reserved_dictionary_MB '; - ELSE - SET @dsql = @dsql + N' 0 AS reserved_dictionary_MB '; - + ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N' +'; SET @dsql = @dsql + N' FROM ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_partition_stats AS ps @@ -24422,9 +24479,6 @@ BEGIN TRY AND so.is_ms_shipped = 0 /*Exclude objects shipped by Microsoft*/ AND so.type <> ''TF'' /*Exclude table valued functions*/ JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.schemas AS s ON s.schema_id = so.schema_id - LEFT JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_index_operational_stats(' - + CAST(@DatabaseID AS NVARCHAR(10)) + N', NULL, NULL,NULL) AS os ON - ps.object_id=os.object_id and ps.index_id=os.index_id and ps.partition_number=os.partition_number OUTER APPLY (SELECT st.lock_escalation_desc FROM ' + QUOTENAME(@DatabaseName) + N'.sys.tables st WHERE st.object_id = ps.object_id @@ -24444,7 +24498,75 @@ BEGIN TRY le.lock_escalation_desc, ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N' ORDER BY ps.object_id, ps.index_id, ps.partition_number - OPTION ( RECOMPILE ); + /*OPTION ( RECOMPILE );*/ + OPTION ( RECOMPILE , min_grant_percent = 1); + + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''start getting data into #dm_db_index_operational_stats at %s.'',0,1, @d) WITH NOWAIT; + + insert into #dm_db_index_operational_stats + ( + database_id + , object_id + , index_id + , partition_number + , hobt_id + , leaf_insert_count + , leaf_delete_count + , leaf_update_count + , range_scan_count + , singleton_lookup_count + , forwarded_fetch_count + , lob_fetch_in_pages + , lob_fetch_in_bytes + , row_overflow_fetch_in_pages + , row_overflow_fetch_in_bytes + , row_lock_count + , row_lock_wait_count + , row_lock_wait_in_ms + , page_lock_count + , page_lock_wait_count + , page_lock_wait_in_ms + , index_lock_promotion_attempt_count + , index_lock_promotion_count + , page_latch_wait_count + , page_latch_wait_in_ms + , page_io_latch_wait_count + , page_io_latch_wait_in_ms + ) + + select os.database_id + , os.object_id + , os.index_id + , os.partition_number + , os.hobt_id + , os.leaf_insert_count + , os.leaf_delete_count + , os.leaf_update_count + , os.range_scan_count + , os.singleton_lookup_count + , os.forwarded_fetch_count + , os.lob_fetch_in_pages + , os.lob_fetch_in_bytes + , os.row_overflow_fetch_in_pages + , os.row_overflow_fetch_in_bytes + , os.row_lock_count + , os.row_lock_wait_count + , os.row_lock_wait_in_ms + , os.page_lock_count + , os.page_lock_wait_count + , os.page_lock_wait_in_ms + , os.index_lock_promotion_attempt_count + , os.index_lock_promotion_count + , os.page_latch_wait_count + , os.page_latch_wait_in_ms + , os.page_io_latch_wait_count + , os.page_io_latch_wait_in_ms + from ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_index_operational_stats('+ CAST(@DatabaseID AS NVARCHAR(10)) +', NULL, NULL,NULL) AS os + OPTION ( RECOMPILE , min_grant_percent = 1); + + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''finished getting data into #dm_db_index_operational_stats at %s.'',0,1, @d) WITH NOWAIT; '; END; ELSE @@ -24543,6 +24665,7 @@ BEGIN TRY PRINT SUBSTRING(@dsql, 32000, 36000); PRINT SUBSTRING(@dsql, 36000, 40000); END; + EXEC sp_executesql @dsql; INSERT #IndexPartitionSanity ( [database_id], [object_id], [schema_name], @@ -24577,8 +24700,35 @@ BEGIN TRY page_io_latch_wait_count, page_io_latch_wait_in_ms, reserved_dictionary_MB) - EXEC sp_executesql @dsql; - + select h.database_id, h.object_id, h.sname, h.index_id, h.partition_number, h.row_count, h.reserved_MB, h.reserved_LOB_MB, h.reserved_row_overflow_MB, h.lock_escalation_desc, h.data_compression_desc, + SUM(os.leaf_insert_count), + SUM(os.leaf_delete_count), + SUM(os.leaf_update_count), + SUM(os.range_scan_count), + SUM(os.singleton_lookup_count), + SUM(os.forwarded_fetch_count), + SUM(os.lob_fetch_in_pages), + SUM(os.lob_fetch_in_bytes), + SUM(os.row_overflow_fetch_in_pages), + SUM(os.row_overflow_fetch_in_bytes), + SUM(os.row_lock_count), + SUM(os.row_lock_wait_count), + SUM(os.row_lock_wait_in_ms), + SUM(os.page_lock_count), + SUM(os.page_lock_wait_count), + SUM(os.page_lock_wait_in_ms), + SUM(os.index_lock_promotion_attempt_count), + SUM(os.index_lock_promotion_count), + SUM(os.page_latch_wait_count), + SUM(os.page_latch_wait_in_ms), + SUM(os.page_io_latch_wait_count), + SUM(os.page_io_latch_wait_in_ms) + ,COALESCE((SELECT SUM (dict.on_disk_size / 1024.0 / 1024) FROM sys.column_store_dictionaries dict WHERE dict.partition_id = h.partition_id),0) AS reserved_dictionary_MB + from #dm_db_partition_stats_etc h + left JOIN #dm_db_index_operational_stats as os ON + h.object_id=os.object_id and h.index_id=os.index_id and h.partition_number=os.partition_number + group by h.database_id, h.object_id, h.sname, h.index_id, h.partition_number, h.partition_id, h.row_count, h.reserved_MB, h.reserved_LOB_MB, h.reserved_row_overflow_MB, h.lock_escalation_desc, h.data_compression_desc + END; --End Check For @SkipPartitions = 0 @@ -25929,7 +26079,7 @@ BEGIN INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.columns c ON rg.object_id = c.object_id INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partitions p ON rg.object_id = p.object_id AND rg.partition_number = p.partition_number INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.index_columns ic on ic.column_id = c.column_id AND ic.object_id = c.object_id AND ic.index_id = p.index_id - LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_column_store_row_group_physical_stats phys ON rg.row_group_id = phys.row_group_id AND rg.object_id = phys.object_id AND rg.partition_number = phys.partition_number AND p.index_id = phys.index_id ' + CASE WHEN @ShowPartitionRanges = 1 THEN N' + LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_column_store_row_group_physical_stats phys ON rg.row_group_id = phys.row_group_id AND rg.object_id = phys.object_id AND rg.partition_number = phys.partition_number AND rg.index_id = phys.index_id ' + CASE WHEN @ShowPartitionRanges = 1 THEN N' LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.indexes i ON i.object_id = rg.object_id AND i.index_id = rg.index_id LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partition_schemes ps ON ps.data_space_id = i.data_space_id LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partition_functions pf ON pf.function_id = ps.function_id @@ -29116,7 +29266,8 @@ BEGIN END; /* End @Mode=3 (index detail)*/ - + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121); + RAISERROR (N'finishing at %s',0,1, @d) WITH NOWAIT; END /* End @TableName IS NULL (mode 0/1/2/3/4) */ END TRY @@ -29174,7 +29325,7 @@ BEGIN SET XACT_ABORT OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF @VersionCheckMode = 1 BEGIN @@ -33329,7 +33480,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN RETURN; @@ -39378,7 +39529,7 @@ BEGIN SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -40771,14 +40922,16 @@ ALTER PROCEDURE [dbo].[sp_DatabaseRestore] @Help BIT = 0, @Version VARCHAR(30) = NULL OUTPUT, @VersionDate DATETIME = NULL OUTPUT, - @VersionCheckMode BIT = 0 + @VersionCheckMode BIT = 0, + @FileNamePrefix NVARCHAR(260) = NULL, + @RunStoredProcAfterRestore NVARCHAR(260) = NULL AS SET NOCOUNT ON; SET STATISTICS XML OFF; /*Versioning details*/ -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -41524,7 +41677,7 @@ BEGIN WHEN Type = 'L' THEN @MoveLogDrive WHEN Type = 'S' THEN @MoveFilestreamDrive WHEN Type = 'F' THEN @MoveFullTextCatalogDrive - END + CASE + END + COALESCE(@FileNamePrefix, '') + CASE WHEN @Database = @RestoreDatabaseName THEN REVERSE(LEFT(REVERSE(PhysicalName), CHARINDEX('\', REVERSE(PhysicalName), 1) -1)) ELSE REPLACE(REVERSE(LEFT(REVERSE(PhysicalName), CHARINDEX('\', REVERSE(PhysicalName), 1) -1)), @Database, SUBSTRING(@RestoreDatabaseName, 2, LEN(@RestoreDatabaseName) -2)) END AS TargetPhysicalName, @@ -42366,6 +42519,28 @@ END;' EXECUTE [dbo].[CommandExecute] @DatabaseContext = 'master', @Command = @sql, @CommandType = 'UPDATE', @Mode = 1, @DatabaseName = @UnquotedRestoreDatabaseName, @LogToTable = 'Y', @Execute = 'Y'; END; +IF @RunStoredProcAfterRestore IS NOT NULL AND LEN(LTRIM(@RunStoredProcAfterRestore)) > 0 +BEGIN + PRINT 'Attempting to run ' + @RunStoredProcAfterRestore + SET @sql = N'EXEC ' + @RestoreDatabaseName + '.' + @RunStoredProcAfterRestore + + IF @Debug = 1 OR @Execute = 'N' + BEGIN + IF @sql IS NULL PRINT '@sql is NULL when building for @RunStoredProcAfterRestore' + PRINT @sql + END + + IF @RunRecovery = 0 + BEGIN + PRINT 'Unable to run Run Stored Procedure After Restore as database is not recovered. Run command again with @RunRecovery = 1' + END + ELSE + BEGIN + IF @Debug IN (0, 1) AND @Execute = 'Y' + EXEC sp_executesql @sql + END +END + -- If test restore then blow the database away (be careful) IF @TestRestore = 1 BEGIN @@ -42425,7 +42600,7 @@ BEGIN SET NOCOUNT ON; SET STATISTICS XML OFF; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -42787,6 +42962,8 @@ DELETE FROM dbo.SqlServerVersions; INSERT INTO dbo.SqlServerVersions (MajorVersionNumber, MinorVersionNumber, Branch, [Url], ReleaseDate, MainstreamSupportEndDate, ExtendedSupportEndDate, MajorVersionName, MinorVersionName) VALUES + (16, 4105, 'CU11', 'https://support.microsoft.com/en-us/help/5032679', '2024-01-11', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 11'), + (16, 4100, 'CU10 GDR', 'https://support.microsoft.com/en-us/help/5033592', '2024-01-09', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 10 GDR'), (16, 4095, 'CU10', 'https://support.microsoft.com/en-us/help/5031778', '2023-11-16', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 10'), (16, 4085, 'CU9', 'https://support.microsoft.com/en-us/help/5030731', '2023-10-12', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 9'), (16, 4075, 'CU8', 'https://support.microsoft.com/en-us/help/5029666', '2023-09-14', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 8'), @@ -42799,6 +42976,7 @@ VALUES (16, 4003, 'CU1', 'https://support.microsoft.com/en-us/help/5022375', '2023-02-16', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 1'), (16, 1050, 'RTM GDR', 'https://support.microsoft.com/kb/5021522', '2023-02-14', '2028-01-11', '2033-01-11', 'SQL Server 2022 GDR', 'RTM'), (16, 1000, 'RTM', '', '2022-11-15', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'RTM'), + (15, 4355, 'CU25', 'https://support.microsoft.com/kb/5033688', '2023-02-15', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 25'), (15, 4345, 'CU24', 'https://support.microsoft.com/kb/5031908', '2023-12-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 24'), (15, 4335, 'CU23', 'https://support.microsoft.com/kb/5030333', '2023-10-12', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 23'), (15, 4322, 'CU22', 'https://support.microsoft.com/kb/5027702', '2023-08-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 22'), @@ -43226,7 +43404,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/Install-Core-Blitz-No-Query-Store.sql b/Install-Core-Blitz-No-Query-Store.sql index 58cd0519..eb2b1df8 100644 --- a/Install-Core-Blitz-No-Query-Store.sql +++ b/Install-Core-Blitz-No-Query-Store.sql @@ -38,7 +38,7 @@ AS SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -201,6 +201,7 @@ AS ,@SkipModel bit = 0 ,@SkipTempDB bit = 0 ,@SkipValidateLogins bit = 0 + ,@SkipGetAlertInfo bit = 0 DECLARE @db_perms table @@ -226,6 +227,23 @@ AS /* End of declarations for First Responder Kit consistency check:*/ ; + /* Create temp table for check 73 */ + IF OBJECT_ID('tempdb..#AlertInfo') IS NOT NULL + EXEC sp_executesql N'DROP TABLE #AlertInfo;'; + + CREATE TABLE #AlertInfo + ( + FailSafeOperator NVARCHAR(255) , + NotificationMethod INT , + ForwardingServer NVARCHAR(255) , + ForwardingSeverity INT , + PagerToTemplate NVARCHAR(255) , + PagerCCTemplate NVARCHAR(255) , + PagerSubjectTemplate NVARCHAR(255) , + PagerSendSubjectOnly NVARCHAR(255) , + ForwardAlways INT + ); + /* Create temp table for check 2301 */ IF OBJECT_ID('tempdb..#InvalidLogins') IS NOT NULL EXEC sp_executesql N'DROP TABLE #InvalidLogins;'; @@ -315,6 +333,20 @@ AS END CATCH; END; /*Need execute on sp_validatelogins*/ + IF ISNULL(@SkipGetAlertInfo, 0) != 1 /*If @SkipGetAlertInfo hasn't been set to 1 by the caller*/ + BEGIN + BEGIN TRY + /* Try to fill the table for check 73 */ + INSERT INTO #AlertInfo + EXEC [master].[dbo].[sp_MSgetalertinfo] @includeaddresses = 0; + + SET @SkipGetAlertInfo = 0; /*We can execute sp_MSgetalertinfo*/ + END TRY + BEGIN CATCH + SET @SkipGetAlertInfo = 1; /*We have don't have execute rights or sp_MSgetalertinfo throws an error so skip it*/ + END CATCH; + END; /*Need execute on sp_MSgetalertinfo*/ + IF ISNULL(@SkipModel, 0) != 1 /*If @SkipModel hasn't been set to 1 by the caller*/ BEGIN IF EXISTS @@ -627,7 +659,7 @@ AS SELECT v.* FROM (VALUES(NULL, 211, NULL)) AS v (DatabaseName, CheckID, ServerName) /*xp_regread*/ - WHERE @SkipXPRegRead = 1; + WHERE @sa = 0; INSERT #SkipChecks (DatabaseName, CheckID, ServerName) SELECT @@ -639,7 +671,13 @@ AS SELECT v.* FROM (VALUES(NULL, 2301, NULL)) AS v (DatabaseName, CheckID, ServerName) /*sp_validatelogins*/ - WHERE @SkipValidateLogins = 1 + WHERE @SkipValidateLogins = 1; + + INSERT #SkipChecks (DatabaseName, CheckID, ServerName) + SELECT + v.* + FROM (VALUES(NULL, 73, NULL)) AS v (DatabaseName, CheckID, ServerName) /*sp_validatelogins*/ + WHERE @SkipGetAlertInfo = 1; IF @sa = 0 BEGIN @@ -840,6 +878,8 @@ AS INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'model'); /* Max file size set */ INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'msdb'); /* Max file size set */ INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'tempdb'); /* Max file size set */ + INSERT INTO #SkipChecks (CheckID) VALUES (224); /* CheckID 224 - Performance - SSRS/SSAS/SSIS Installed */ + INSERT INTO #SkipChecks (CheckID) VALUES (92); /* CheckID 92 - drive space */ INSERT INTO #BlitzResults ( CheckID , Priority , @@ -1160,7 +1200,7 @@ AS IF @BringThePain = 0 AND 50 <= (SELECT COUNT(*) FROM sys.databases) AND @CheckUserDatabaseObjects = 1 BEGIN SET @CheckUserDatabaseObjects = 0; - PRINT 'Running sp_Blitz @CheckUserDatabaseObjects = 1 on a server with 50+ databases may cause temporary insanity for the server and/or user.'; + PRINT 'Running sp_Blitz @CheckUserDatabaseObjects = 1 on a server with 50+ databases may cause temporary problems for the server and/or user.'; PRINT 'If you''re sure you want to do this, run again with the parameter @BringThePain = 1.'; INSERT INTO #BlitzResults ( CheckID , @@ -3394,23 +3434,6 @@ AS IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 53) WITH NOWAIT; - --INSERT INTO #BlitzResults - -- ( CheckID , - -- Priority , - -- FindingsGroup , - -- Finding , - -- URL , - -- Details - -- ) - -- SELECT TOP 1 - -- 53 AS CheckID , - -- 200 AS Priority , - -- 'Informational' AS FindingsGroup , - -- 'Cluster Node' AS Finding , - -- 'https://BrentOzar.com/go/node' AS URL , - -- 'This is a node in a cluster.' AS Details - -- FROM sys.dm_os_cluster_nodes; - DECLARE @AOFCI AS INT, @AOAG AS INT, @HAType AS VARCHAR(10), @errmsg AS VARCHAR(200) SELECT @AOAG = CAST(SERVERPROPERTY('IsHadrEnabled') AS INT) @@ -3441,7 +3464,7 @@ AS Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node' AS Finding , @@ -3458,7 +3481,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -3484,7 +3507,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -3509,7 +3532,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -4820,6 +4843,10 @@ AS FROM sys.all_columns WHERE name = 'is_memory_optimized_elevate_to_snapshot_on' AND object_id = OBJECT_ID('sys.databases') AND SERVERPROPERTY('EngineEdition') <> 8; /* Hekaton is always enabled in Managed Instances per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */ + INSERT INTO #DatabaseDefaults + SELECT 'is_accelerated_database_recovery_on', 0, 145, 210, 'Acclerated Database Recovery Enabled', 'https://www.brentozar.com/go/dbdefaults', NULL + FROM sys.all_columns + WHERE name = 'is_accelerated_database_recovery_on' AND object_id = OBJECT_ID('sys.databases') AND SERVERPROPERTY('EngineEdition') NOT IN (5, 8) ; DECLARE DatabaseDefaultsLoop CURSOR FOR SELECT name, DefaultValue, CheckID, Priority, Finding, URL, Details @@ -8211,20 +8238,6 @@ IF @ProductVersionMajor >= 10 IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 73) WITH NOWAIT; - DECLARE @AlertInfo TABLE - ( - FailSafeOperator NVARCHAR(255) , - NotificationMethod INT , - ForwardingServer NVARCHAR(255) , - ForwardingSeverity INT , - PagerToTemplate NVARCHAR(255) , - PagerCCTemplate NVARCHAR(255) , - PagerSubjectTemplate NVARCHAR(255) , - PagerSendSubjectOnly NVARCHAR(255) , - ForwardAlways INT - ); - INSERT INTO @AlertInfo - EXEC [master].[dbo].[sp_MSgetalertinfo] @includeaddresses = 0; INSERT INTO #BlitzResults ( CheckID , Priority , @@ -8239,7 +8252,7 @@ IF @ProductVersionMajor >= 10 'No Failsafe Operator Configured' AS Finding , 'https://www.brentozar.com/go/failsafe' AS URL , ( 'No failsafe operator is configured on this server. This is a good idea just in-case there are issues with the [msdb] database that prevents alerting.' ) AS Details - FROM @AlertInfo + FROM #AlertInfo WHERE FailSafeOperator IS NULL; END; @@ -10046,6 +10059,11 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1 EXEC sp_executesql N'DROP TABLE #InvalidLogins;'; END; + IF OBJECT_ID('tempdb..#AlertInfo') IS NOT NULL + BEGIN + EXEC sp_executesql N'DROP TABLE #AlertInfo;'; + END; + /* Reset the Nmumeric_RoundAbort session state back to enabled if it was disabled earlier. See Github issue #2302 for more info. @@ -10105,7 +10123,7 @@ AS SET NOCOUNT ON; SET STATISTICS XML OFF; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -10983,7 +11001,7 @@ AS SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -12765,7 +12783,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -12952,7 +12970,7 @@ IF @Help = 1 UNION ALL SELECT N'@MinutesBack', N'INT', - N'How many minutes back to begin plan cache analysis. If you put in a positive number, we''ll flip it to negtive.'; + N'How many minutes back to begin plan cache analysis. If you put in a positive number, we''ll flip it to negative.'; /* Column definitions */ @@ -20124,7 +20142,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -20153,7 +20171,7 @@ Known limitations of this version: filegroup/partition scheme etc.) -- (The compression and filegroup index create syntax is not trivial because it is set at the partition level and is not trivial to code.) - - Does not advise you about data modeling for clustered indexes and primary keys (primarily looks for signs of insanity.) + - Does not advise you about data modeling for clustered indexes and primary keys (primarily looks for signs of problems.) Unknown limitations of this version: - We knew them once, but we forgot. @@ -20329,9 +20347,14 @@ IF OBJECT_ID('tempdb..#CheckConstraints') IS NOT NULL IF OBJECT_ID('tempdb..#FilteredIndexes') IS NOT NULL DROP TABLE #FilteredIndexes; - + IF OBJECT_ID('tempdb..#Ignore_Databases') IS NOT NULL DROP TABLE #Ignore_Databases + +IF OBJECT_ID('tempdb..#dm_db_partition_stats_etc') IS NOT NULL + DROP TABLE #dm_db_partition_stats_etc +IF OBJECT_ID('tempdb..#dm_db_index_operational_stats') IS NOT NULL + DROP TABLE #dm_db_index_operational_stats RAISERROR (N'Create temp tables.',0,1) WITH NOWAIT; CREATE TABLE #BlitzIndexResults @@ -20995,7 +21018,7 @@ BEGIN TRY VALUES ( 1, 0, N'You''re trying to run sp_BlitzIndex on a server with ' + CAST(@NumDatabases AS NVARCHAR(8)) + N' databases. ', - N'Running sp_BlitzIndex on a server with 50+ databases may cause temporary insanity for the server and/or user.', + N'Running sp_BlitzIndex on a server with 50+ databases may cause temporary problems for the server and/or user.', N'If you''re sure you want to do this, run again with the parameter @BringThePain = 1.', 'http://FirstResponderKit.org', '', @@ -21022,7 +21045,7 @@ BEGIN TRY bir.create_tsql, bir.more_info FROM #BlitzIndexResults AS bir; - RAISERROR('Running sp_BlitzIndex on a server with 50+ databases may cause temporary insanity for the server', 12, 1); + RAISERROR('Running sp_BlitzIndex on a server with 50+ databases may cause temporary problems for the server', 12, 1); END; RETURN; @@ -21141,6 +21164,8 @@ FROM sys.databases ---------------------------------------- BEGIN TRY BEGIN + DECLARE @d VARCHAR(19) = CONVERT(VARCHAR(19), GETDATE(), 121); + RAISERROR (N'starting at %s',0,1, @d) WITH NOWAIT; --Validate SQL Server Version @@ -21511,47 +21536,79 @@ BEGIN TRY --NOTE: If you want to use the newer syntax for 2012+, you'll have to change 2147483647 to 11 on line ~819 --This change was made because on a table with lots of paritions, the OUTER APPLY was crazy slow. - SET @dsql = N'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; + + -- get relevant columns from sys.dm_db_partition_stats, sys.partitions and sys.objects + DROP TABLE if exists #dm_db_partition_stats_etc + create table #dm_db_partition_stats_etc + ( + database_id smallint not null + , object_id int not null + , sname sysname NULL + , index_id int + , partition_number int + , partition_id bigint + , row_count bigint + , reserved_MB bigint + , reserved_LOB_MB bigint + , reserved_row_overflow_MB bigint + , lock_escalation_desc nvarchar(60) + , data_compression_desc nvarchar(60) + ) + + -- get relevant info from sys.dm_db_index_operational_stats + drop TABLE if exists #dm_db_index_operational_stats + create table #dm_db_index_operational_stats + ( + database_id smallint not null + , object_id int not null + , index_id int + , partition_number int + , hobt_id bigint + , leaf_insert_count bigint + , leaf_delete_count bigint + , leaf_update_count bigint + , range_scan_count bigint + , singleton_lookup_count bigint + , forwarded_fetch_count bigint + , lob_fetch_in_pages bigint + , lob_fetch_in_bytes bigint + , row_overflow_fetch_in_pages bigint + , row_overflow_fetch_in_bytes bigint + , row_lock_count bigint + , row_lock_wait_count bigint + , row_lock_wait_in_ms bigint + , page_lock_count bigint + , page_lock_wait_count bigint + , page_lock_wait_in_ms bigint + , index_lock_promotion_attempt_count bigint + , index_lock_promotion_count bigint + , page_latch_wait_count bigint + , page_latch_wait_in_ms bigint + , page_io_latch_wait_count bigint + , page_io_latch_wait_in_ms bigint + ) + + SET @dsql = N' + DECLARE @d VARCHAR(19) = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''start getting data into #dm_db_partition_stats_etc at %s'',0,1, @d) WITH NOWAIT; + SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; + INSERT INTO #dm_db_partition_stats_etc + ( + database_id, object_id, sname, index_id, partition_number, partition_id, row_count, reserved_MB, reserved_LOB_MB, reserved_row_overflow_MB, lock_escalation_desc, data_compression_desc + ) SELECT ' + CAST(@DatabaseID AS NVARCHAR(10)) + N' AS database_id, ps.object_id, - s.name, + s.name as sname, ps.index_id, ps.partition_number, + ps.partition_id, ps.row_count, ps.reserved_page_count * 8. / 1024. AS reserved_MB, ps.lob_reserved_page_count * 8. / 1024. AS reserved_LOB_MB, ps.row_overflow_reserved_page_count * 8. / 1024. AS reserved_row_overflow_MB, le.lock_escalation_desc, - ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N', - SUM(os.leaf_insert_count), - SUM(os.leaf_delete_count), - SUM(os.leaf_update_count), - SUM(os.range_scan_count), - SUM(os.singleton_lookup_count), - SUM(os.forwarded_fetch_count), - SUM(os.lob_fetch_in_pages), - SUM(os.lob_fetch_in_bytes), - SUM(os.row_overflow_fetch_in_pages), - SUM(os.row_overflow_fetch_in_bytes), - SUM(os.row_lock_count), - SUM(os.row_lock_wait_count), - SUM(os.row_lock_wait_in_ms), - SUM(os.page_lock_count), - SUM(os.page_lock_wait_count), - SUM(os.page_lock_wait_in_ms), - SUM(os.index_lock_promotion_attempt_count), - SUM(os.index_lock_promotion_count), - SUM(os.page_latch_wait_count), - SUM(os.page_latch_wait_in_ms), - SUM(os.page_io_latch_wait_count), - SUM(os.page_io_latch_wait_in_ms), '; - - /* Get columnstore dictionary size - more info: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2585 */ - IF EXISTS (SELECT * FROM sys.all_objects WHERE name = 'column_store_dictionaries') - SET @dsql = @dsql + N' COALESCE((SELECT SUM (on_disk_size / 1024.0 / 1024) FROM ' + QUOTENAME(@DatabaseName) + N'.sys.column_store_dictionaries dict WHERE dict.partition_id = ps.partition_id),0) AS reserved_dictionary_MB '; - ELSE - SET @dsql = @dsql + N' 0 AS reserved_dictionary_MB '; - + ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N' +'; SET @dsql = @dsql + N' FROM ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_partition_stats AS ps @@ -21560,9 +21617,6 @@ BEGIN TRY AND so.is_ms_shipped = 0 /*Exclude objects shipped by Microsoft*/ AND so.type <> ''TF'' /*Exclude table valued functions*/ JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.schemas AS s ON s.schema_id = so.schema_id - LEFT JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_index_operational_stats(' - + CAST(@DatabaseID AS NVARCHAR(10)) + N', NULL, NULL,NULL) AS os ON - ps.object_id=os.object_id and ps.index_id=os.index_id and ps.partition_number=os.partition_number OUTER APPLY (SELECT st.lock_escalation_desc FROM ' + QUOTENAME(@DatabaseName) + N'.sys.tables st WHERE st.object_id = ps.object_id @@ -21582,7 +21636,75 @@ BEGIN TRY le.lock_escalation_desc, ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N' ORDER BY ps.object_id, ps.index_id, ps.partition_number - OPTION ( RECOMPILE ); + /*OPTION ( RECOMPILE );*/ + OPTION ( RECOMPILE , min_grant_percent = 1); + + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''start getting data into #dm_db_index_operational_stats at %s.'',0,1, @d) WITH NOWAIT; + + insert into #dm_db_index_operational_stats + ( + database_id + , object_id + , index_id + , partition_number + , hobt_id + , leaf_insert_count + , leaf_delete_count + , leaf_update_count + , range_scan_count + , singleton_lookup_count + , forwarded_fetch_count + , lob_fetch_in_pages + , lob_fetch_in_bytes + , row_overflow_fetch_in_pages + , row_overflow_fetch_in_bytes + , row_lock_count + , row_lock_wait_count + , row_lock_wait_in_ms + , page_lock_count + , page_lock_wait_count + , page_lock_wait_in_ms + , index_lock_promotion_attempt_count + , index_lock_promotion_count + , page_latch_wait_count + , page_latch_wait_in_ms + , page_io_latch_wait_count + , page_io_latch_wait_in_ms + ) + + select os.database_id + , os.object_id + , os.index_id + , os.partition_number + , os.hobt_id + , os.leaf_insert_count + , os.leaf_delete_count + , os.leaf_update_count + , os.range_scan_count + , os.singleton_lookup_count + , os.forwarded_fetch_count + , os.lob_fetch_in_pages + , os.lob_fetch_in_bytes + , os.row_overflow_fetch_in_pages + , os.row_overflow_fetch_in_bytes + , os.row_lock_count + , os.row_lock_wait_count + , os.row_lock_wait_in_ms + , os.page_lock_count + , os.page_lock_wait_count + , os.page_lock_wait_in_ms + , os.index_lock_promotion_attempt_count + , os.index_lock_promotion_count + , os.page_latch_wait_count + , os.page_latch_wait_in_ms + , os.page_io_latch_wait_count + , os.page_io_latch_wait_in_ms + from ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_index_operational_stats('+ CAST(@DatabaseID AS NVARCHAR(10)) +', NULL, NULL,NULL) AS os + OPTION ( RECOMPILE , min_grant_percent = 1); + + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''finished getting data into #dm_db_index_operational_stats at %s.'',0,1, @d) WITH NOWAIT; '; END; ELSE @@ -21681,6 +21803,7 @@ BEGIN TRY PRINT SUBSTRING(@dsql, 32000, 36000); PRINT SUBSTRING(@dsql, 36000, 40000); END; + EXEC sp_executesql @dsql; INSERT #IndexPartitionSanity ( [database_id], [object_id], [schema_name], @@ -21715,8 +21838,35 @@ BEGIN TRY page_io_latch_wait_count, page_io_latch_wait_in_ms, reserved_dictionary_MB) - EXEC sp_executesql @dsql; - + select h.database_id, h.object_id, h.sname, h.index_id, h.partition_number, h.row_count, h.reserved_MB, h.reserved_LOB_MB, h.reserved_row_overflow_MB, h.lock_escalation_desc, h.data_compression_desc, + SUM(os.leaf_insert_count), + SUM(os.leaf_delete_count), + SUM(os.leaf_update_count), + SUM(os.range_scan_count), + SUM(os.singleton_lookup_count), + SUM(os.forwarded_fetch_count), + SUM(os.lob_fetch_in_pages), + SUM(os.lob_fetch_in_bytes), + SUM(os.row_overflow_fetch_in_pages), + SUM(os.row_overflow_fetch_in_bytes), + SUM(os.row_lock_count), + SUM(os.row_lock_wait_count), + SUM(os.row_lock_wait_in_ms), + SUM(os.page_lock_count), + SUM(os.page_lock_wait_count), + SUM(os.page_lock_wait_in_ms), + SUM(os.index_lock_promotion_attempt_count), + SUM(os.index_lock_promotion_count), + SUM(os.page_latch_wait_count), + SUM(os.page_latch_wait_in_ms), + SUM(os.page_io_latch_wait_count), + SUM(os.page_io_latch_wait_in_ms) + ,COALESCE((SELECT SUM (dict.on_disk_size / 1024.0 / 1024) FROM sys.column_store_dictionaries dict WHERE dict.partition_id = h.partition_id),0) AS reserved_dictionary_MB + from #dm_db_partition_stats_etc h + left JOIN #dm_db_index_operational_stats as os ON + h.object_id=os.object_id and h.index_id=os.index_id and h.partition_number=os.partition_number + group by h.database_id, h.object_id, h.sname, h.index_id, h.partition_number, h.partition_id, h.row_count, h.reserved_MB, h.reserved_LOB_MB, h.reserved_row_overflow_MB, h.lock_escalation_desc, h.data_compression_desc + END; --End Check For @SkipPartitions = 0 @@ -23067,7 +23217,7 @@ BEGIN INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.columns c ON rg.object_id = c.object_id INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partitions p ON rg.object_id = p.object_id AND rg.partition_number = p.partition_number INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.index_columns ic on ic.column_id = c.column_id AND ic.object_id = c.object_id AND ic.index_id = p.index_id - LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_column_store_row_group_physical_stats phys ON rg.row_group_id = phys.row_group_id AND rg.object_id = phys.object_id AND rg.partition_number = phys.partition_number AND p.index_id = phys.index_id ' + CASE WHEN @ShowPartitionRanges = 1 THEN N' + LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_column_store_row_group_physical_stats phys ON rg.row_group_id = phys.row_group_id AND rg.object_id = phys.object_id AND rg.partition_number = phys.partition_number AND rg.index_id = phys.index_id ' + CASE WHEN @ShowPartitionRanges = 1 THEN N' LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.indexes i ON i.object_id = rg.object_id AND i.index_id = rg.index_id LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partition_schemes ps ON ps.data_space_id = i.data_space_id LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partition_functions pf ON pf.function_id = ps.function_id @@ -26254,7 +26404,8 @@ BEGIN END; /* End @Mode=3 (index detail)*/ - + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121); + RAISERROR (N'finishing at %s',0,1, @d) WITH NOWAIT; END /* End @TableName IS NULL (mode 0/1/2/3/4) */ END TRY @@ -26312,7 +26463,7 @@ BEGIN SET XACT_ABORT OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF @VersionCheckMode = 1 BEGIN @@ -30443,7 +30594,7 @@ BEGIN SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -31839,6 +31990,8 @@ DELETE FROM dbo.SqlServerVersions; INSERT INTO dbo.SqlServerVersions (MajorVersionNumber, MinorVersionNumber, Branch, [Url], ReleaseDate, MainstreamSupportEndDate, ExtendedSupportEndDate, MajorVersionName, MinorVersionName) VALUES + (16, 4105, 'CU11', 'https://support.microsoft.com/en-us/help/5032679', '2024-01-11', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 11'), + (16, 4100, 'CU10 GDR', 'https://support.microsoft.com/en-us/help/5033592', '2024-01-09', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 10 GDR'), (16, 4095, 'CU10', 'https://support.microsoft.com/en-us/help/5031778', '2023-11-16', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 10'), (16, 4085, 'CU9', 'https://support.microsoft.com/en-us/help/5030731', '2023-10-12', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 9'), (16, 4075, 'CU8', 'https://support.microsoft.com/en-us/help/5029666', '2023-09-14', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 8'), @@ -31851,6 +32004,7 @@ VALUES (16, 4003, 'CU1', 'https://support.microsoft.com/en-us/help/5022375', '2023-02-16', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 1'), (16, 1050, 'RTM GDR', 'https://support.microsoft.com/kb/5021522', '2023-02-14', '2028-01-11', '2033-01-11', 'SQL Server 2022 GDR', 'RTM'), (16, 1000, 'RTM', '', '2022-11-15', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'RTM'), + (15, 4355, 'CU25', 'https://support.microsoft.com/kb/5033688', '2023-02-15', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 25'), (15, 4345, 'CU24', 'https://support.microsoft.com/kb/5031908', '2023-12-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 24'), (15, 4335, 'CU23', 'https://support.microsoft.com/kb/5030333', '2023-10-12', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 23'), (15, 4322, 'CU22', 'https://support.microsoft.com/kb/5027702', '2023-08-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 22'), @@ -32278,7 +32432,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/Install-Core-Blitz-With-Query-Store.sql b/Install-Core-Blitz-With-Query-Store.sql index 2724cc92..44c08d66 100644 --- a/Install-Core-Blitz-With-Query-Store.sql +++ b/Install-Core-Blitz-With-Query-Store.sql @@ -38,7 +38,7 @@ AS SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -201,6 +201,7 @@ AS ,@SkipModel bit = 0 ,@SkipTempDB bit = 0 ,@SkipValidateLogins bit = 0 + ,@SkipGetAlertInfo bit = 0 DECLARE @db_perms table @@ -226,6 +227,23 @@ AS /* End of declarations for First Responder Kit consistency check:*/ ; + /* Create temp table for check 73 */ + IF OBJECT_ID('tempdb..#AlertInfo') IS NOT NULL + EXEC sp_executesql N'DROP TABLE #AlertInfo;'; + + CREATE TABLE #AlertInfo + ( + FailSafeOperator NVARCHAR(255) , + NotificationMethod INT , + ForwardingServer NVARCHAR(255) , + ForwardingSeverity INT , + PagerToTemplate NVARCHAR(255) , + PagerCCTemplate NVARCHAR(255) , + PagerSubjectTemplate NVARCHAR(255) , + PagerSendSubjectOnly NVARCHAR(255) , + ForwardAlways INT + ); + /* Create temp table for check 2301 */ IF OBJECT_ID('tempdb..#InvalidLogins') IS NOT NULL EXEC sp_executesql N'DROP TABLE #InvalidLogins;'; @@ -315,6 +333,20 @@ AS END CATCH; END; /*Need execute on sp_validatelogins*/ + IF ISNULL(@SkipGetAlertInfo, 0) != 1 /*If @SkipGetAlertInfo hasn't been set to 1 by the caller*/ + BEGIN + BEGIN TRY + /* Try to fill the table for check 73 */ + INSERT INTO #AlertInfo + EXEC [master].[dbo].[sp_MSgetalertinfo] @includeaddresses = 0; + + SET @SkipGetAlertInfo = 0; /*We can execute sp_MSgetalertinfo*/ + END TRY + BEGIN CATCH + SET @SkipGetAlertInfo = 1; /*We have don't have execute rights or sp_MSgetalertinfo throws an error so skip it*/ + END CATCH; + END; /*Need execute on sp_MSgetalertinfo*/ + IF ISNULL(@SkipModel, 0) != 1 /*If @SkipModel hasn't been set to 1 by the caller*/ BEGIN IF EXISTS @@ -627,7 +659,7 @@ AS SELECT v.* FROM (VALUES(NULL, 211, NULL)) AS v (DatabaseName, CheckID, ServerName) /*xp_regread*/ - WHERE @SkipXPRegRead = 1; + WHERE @sa = 0; INSERT #SkipChecks (DatabaseName, CheckID, ServerName) SELECT @@ -639,7 +671,13 @@ AS SELECT v.* FROM (VALUES(NULL, 2301, NULL)) AS v (DatabaseName, CheckID, ServerName) /*sp_validatelogins*/ - WHERE @SkipValidateLogins = 1 + WHERE @SkipValidateLogins = 1; + + INSERT #SkipChecks (DatabaseName, CheckID, ServerName) + SELECT + v.* + FROM (VALUES(NULL, 73, NULL)) AS v (DatabaseName, CheckID, ServerName) /*sp_validatelogins*/ + WHERE @SkipGetAlertInfo = 1; IF @sa = 0 BEGIN @@ -840,6 +878,8 @@ AS INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'model'); /* Max file size set */ INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'msdb'); /* Max file size set */ INSERT INTO #SkipChecks (CheckID, DatabaseName) VALUES (80, 'tempdb'); /* Max file size set */ + INSERT INTO #SkipChecks (CheckID) VALUES (224); /* CheckID 224 - Performance - SSRS/SSAS/SSIS Installed */ + INSERT INTO #SkipChecks (CheckID) VALUES (92); /* CheckID 92 - drive space */ INSERT INTO #BlitzResults ( CheckID , Priority , @@ -1160,7 +1200,7 @@ AS IF @BringThePain = 0 AND 50 <= (SELECT COUNT(*) FROM sys.databases) AND @CheckUserDatabaseObjects = 1 BEGIN SET @CheckUserDatabaseObjects = 0; - PRINT 'Running sp_Blitz @CheckUserDatabaseObjects = 1 on a server with 50+ databases may cause temporary insanity for the server and/or user.'; + PRINT 'Running sp_Blitz @CheckUserDatabaseObjects = 1 on a server with 50+ databases may cause temporary problems for the server and/or user.'; PRINT 'If you''re sure you want to do this, run again with the parameter @BringThePain = 1.'; INSERT INTO #BlitzResults ( CheckID , @@ -3394,23 +3434,6 @@ AS IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 53) WITH NOWAIT; - --INSERT INTO #BlitzResults - -- ( CheckID , - -- Priority , - -- FindingsGroup , - -- Finding , - -- URL , - -- Details - -- ) - -- SELECT TOP 1 - -- 53 AS CheckID , - -- 200 AS Priority , - -- 'Informational' AS FindingsGroup , - -- 'Cluster Node' AS Finding , - -- 'https://BrentOzar.com/go/node' AS URL , - -- 'This is a node in a cluster.' AS Details - -- FROM sys.dm_os_cluster_nodes; - DECLARE @AOFCI AS INT, @AOAG AS INT, @HAType AS VARCHAR(10), @errmsg AS VARCHAR(200) SELECT @AOAG = CAST(SERVERPROPERTY('IsHadrEnabled') AS INT) @@ -3441,7 +3464,7 @@ AS Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node' AS Finding , @@ -3458,7 +3481,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -3484,7 +3507,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -3509,7 +3532,7 @@ AS URL , Details ) - SELECT 53 AS CheckID , + SELECT DISTINCT 53 AS CheckID , 200 AS Priority , 'Informational' AS FindingsGroup , 'Cluster Node Info' AS Finding , @@ -4820,6 +4843,10 @@ AS FROM sys.all_columns WHERE name = 'is_memory_optimized_elevate_to_snapshot_on' AND object_id = OBJECT_ID('sys.databases') AND SERVERPROPERTY('EngineEdition') <> 8; /* Hekaton is always enabled in Managed Instances per https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/1919 */ + INSERT INTO #DatabaseDefaults + SELECT 'is_accelerated_database_recovery_on', 0, 145, 210, 'Acclerated Database Recovery Enabled', 'https://www.brentozar.com/go/dbdefaults', NULL + FROM sys.all_columns + WHERE name = 'is_accelerated_database_recovery_on' AND object_id = OBJECT_ID('sys.databases') AND SERVERPROPERTY('EngineEdition') NOT IN (5, 8) ; DECLARE DatabaseDefaultsLoop CURSOR FOR SELECT name, DefaultValue, CheckID, Priority, Finding, URL, Details @@ -8211,20 +8238,6 @@ IF @ProductVersionMajor >= 10 IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 73) WITH NOWAIT; - DECLARE @AlertInfo TABLE - ( - FailSafeOperator NVARCHAR(255) , - NotificationMethod INT , - ForwardingServer NVARCHAR(255) , - ForwardingSeverity INT , - PagerToTemplate NVARCHAR(255) , - PagerCCTemplate NVARCHAR(255) , - PagerSubjectTemplate NVARCHAR(255) , - PagerSendSubjectOnly NVARCHAR(255) , - ForwardAlways INT - ); - INSERT INTO @AlertInfo - EXEC [master].[dbo].[sp_MSgetalertinfo] @includeaddresses = 0; INSERT INTO #BlitzResults ( CheckID , Priority , @@ -8239,7 +8252,7 @@ IF @ProductVersionMajor >= 10 'No Failsafe Operator Configured' AS Finding , 'https://www.brentozar.com/go/failsafe' AS URL , ( 'No failsafe operator is configured on this server. This is a good idea just in-case there are issues with the [msdb] database that prevents alerting.' ) AS Details - FROM @AlertInfo + FROM #AlertInfo WHERE FailSafeOperator IS NULL; END; @@ -10046,6 +10059,11 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1 EXEC sp_executesql N'DROP TABLE #InvalidLogins;'; END; + IF OBJECT_ID('tempdb..#AlertInfo') IS NOT NULL + BEGIN + EXEC sp_executesql N'DROP TABLE #AlertInfo;'; + END; + /* Reset the Nmumeric_RoundAbort session state back to enabled if it was disabled earlier. See Github issue #2302 for more info. @@ -10105,7 +10123,7 @@ AS SET NOCOUNT ON; SET STATISTICS XML OFF; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -10983,7 +11001,7 @@ AS SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -12765,7 +12783,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -12952,7 +12970,7 @@ IF @Help = 1 UNION ALL SELECT N'@MinutesBack', N'INT', - N'How many minutes back to begin plan cache analysis. If you put in a positive number, we''ll flip it to negtive.'; + N'How many minutes back to begin plan cache analysis. If you put in a positive number, we''ll flip it to negative.'; /* Column definitions */ @@ -20124,7 +20142,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) @@ -20153,7 +20171,7 @@ Known limitations of this version: filegroup/partition scheme etc.) -- (The compression and filegroup index create syntax is not trivial because it is set at the partition level and is not trivial to code.) - - Does not advise you about data modeling for clustered indexes and primary keys (primarily looks for signs of insanity.) + - Does not advise you about data modeling for clustered indexes and primary keys (primarily looks for signs of problems.) Unknown limitations of this version: - We knew them once, but we forgot. @@ -20329,9 +20347,14 @@ IF OBJECT_ID('tempdb..#CheckConstraints') IS NOT NULL IF OBJECT_ID('tempdb..#FilteredIndexes') IS NOT NULL DROP TABLE #FilteredIndexes; - + IF OBJECT_ID('tempdb..#Ignore_Databases') IS NOT NULL DROP TABLE #Ignore_Databases + +IF OBJECT_ID('tempdb..#dm_db_partition_stats_etc') IS NOT NULL + DROP TABLE #dm_db_partition_stats_etc +IF OBJECT_ID('tempdb..#dm_db_index_operational_stats') IS NOT NULL + DROP TABLE #dm_db_index_operational_stats RAISERROR (N'Create temp tables.',0,1) WITH NOWAIT; CREATE TABLE #BlitzIndexResults @@ -20995,7 +21018,7 @@ BEGIN TRY VALUES ( 1, 0, N'You''re trying to run sp_BlitzIndex on a server with ' + CAST(@NumDatabases AS NVARCHAR(8)) + N' databases. ', - N'Running sp_BlitzIndex on a server with 50+ databases may cause temporary insanity for the server and/or user.', + N'Running sp_BlitzIndex on a server with 50+ databases may cause temporary problems for the server and/or user.', N'If you''re sure you want to do this, run again with the parameter @BringThePain = 1.', 'http://FirstResponderKit.org', '', @@ -21022,7 +21045,7 @@ BEGIN TRY bir.create_tsql, bir.more_info FROM #BlitzIndexResults AS bir; - RAISERROR('Running sp_BlitzIndex on a server with 50+ databases may cause temporary insanity for the server', 12, 1); + RAISERROR('Running sp_BlitzIndex on a server with 50+ databases may cause temporary problems for the server', 12, 1); END; RETURN; @@ -21141,6 +21164,8 @@ FROM sys.databases ---------------------------------------- BEGIN TRY BEGIN + DECLARE @d VARCHAR(19) = CONVERT(VARCHAR(19), GETDATE(), 121); + RAISERROR (N'starting at %s',0,1, @d) WITH NOWAIT; --Validate SQL Server Version @@ -21511,47 +21536,79 @@ BEGIN TRY --NOTE: If you want to use the newer syntax for 2012+, you'll have to change 2147483647 to 11 on line ~819 --This change was made because on a table with lots of paritions, the OUTER APPLY was crazy slow. - SET @dsql = N'SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; + + -- get relevant columns from sys.dm_db_partition_stats, sys.partitions and sys.objects + DROP TABLE if exists #dm_db_partition_stats_etc + create table #dm_db_partition_stats_etc + ( + database_id smallint not null + , object_id int not null + , sname sysname NULL + , index_id int + , partition_number int + , partition_id bigint + , row_count bigint + , reserved_MB bigint + , reserved_LOB_MB bigint + , reserved_row_overflow_MB bigint + , lock_escalation_desc nvarchar(60) + , data_compression_desc nvarchar(60) + ) + + -- get relevant info from sys.dm_db_index_operational_stats + drop TABLE if exists #dm_db_index_operational_stats + create table #dm_db_index_operational_stats + ( + database_id smallint not null + , object_id int not null + , index_id int + , partition_number int + , hobt_id bigint + , leaf_insert_count bigint + , leaf_delete_count bigint + , leaf_update_count bigint + , range_scan_count bigint + , singleton_lookup_count bigint + , forwarded_fetch_count bigint + , lob_fetch_in_pages bigint + , lob_fetch_in_bytes bigint + , row_overflow_fetch_in_pages bigint + , row_overflow_fetch_in_bytes bigint + , row_lock_count bigint + , row_lock_wait_count bigint + , row_lock_wait_in_ms bigint + , page_lock_count bigint + , page_lock_wait_count bigint + , page_lock_wait_in_ms bigint + , index_lock_promotion_attempt_count bigint + , index_lock_promotion_count bigint + , page_latch_wait_count bigint + , page_latch_wait_in_ms bigint + , page_io_latch_wait_count bigint + , page_io_latch_wait_in_ms bigint + ) + + SET @dsql = N' + DECLARE @d VARCHAR(19) = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''start getting data into #dm_db_partition_stats_etc at %s'',0,1, @d) WITH NOWAIT; + SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; + INSERT INTO #dm_db_partition_stats_etc + ( + database_id, object_id, sname, index_id, partition_number, partition_id, row_count, reserved_MB, reserved_LOB_MB, reserved_row_overflow_MB, lock_escalation_desc, data_compression_desc + ) SELECT ' + CAST(@DatabaseID AS NVARCHAR(10)) + N' AS database_id, ps.object_id, - s.name, + s.name as sname, ps.index_id, ps.partition_number, + ps.partition_id, ps.row_count, ps.reserved_page_count * 8. / 1024. AS reserved_MB, ps.lob_reserved_page_count * 8. / 1024. AS reserved_LOB_MB, ps.row_overflow_reserved_page_count * 8. / 1024. AS reserved_row_overflow_MB, le.lock_escalation_desc, - ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N', - SUM(os.leaf_insert_count), - SUM(os.leaf_delete_count), - SUM(os.leaf_update_count), - SUM(os.range_scan_count), - SUM(os.singleton_lookup_count), - SUM(os.forwarded_fetch_count), - SUM(os.lob_fetch_in_pages), - SUM(os.lob_fetch_in_bytes), - SUM(os.row_overflow_fetch_in_pages), - SUM(os.row_overflow_fetch_in_bytes), - SUM(os.row_lock_count), - SUM(os.row_lock_wait_count), - SUM(os.row_lock_wait_in_ms), - SUM(os.page_lock_count), - SUM(os.page_lock_wait_count), - SUM(os.page_lock_wait_in_ms), - SUM(os.index_lock_promotion_attempt_count), - SUM(os.index_lock_promotion_count), - SUM(os.page_latch_wait_count), - SUM(os.page_latch_wait_in_ms), - SUM(os.page_io_latch_wait_count), - SUM(os.page_io_latch_wait_in_ms), '; - - /* Get columnstore dictionary size - more info: https://github.com/BrentOzarULTD/SQL-Server-First-Responder-Kit/issues/2585 */ - IF EXISTS (SELECT * FROM sys.all_objects WHERE name = 'column_store_dictionaries') - SET @dsql = @dsql + N' COALESCE((SELECT SUM (on_disk_size / 1024.0 / 1024) FROM ' + QUOTENAME(@DatabaseName) + N'.sys.column_store_dictionaries dict WHERE dict.partition_id = ps.partition_id),0) AS reserved_dictionary_MB '; - ELSE - SET @dsql = @dsql + N' 0 AS reserved_dictionary_MB '; - + ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N' +'; SET @dsql = @dsql + N' FROM ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_partition_stats AS ps @@ -21560,9 +21617,6 @@ BEGIN TRY AND so.is_ms_shipped = 0 /*Exclude objects shipped by Microsoft*/ AND so.type <> ''TF'' /*Exclude table valued functions*/ JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.schemas AS s ON s.schema_id = so.schema_id - LEFT JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_index_operational_stats(' - + CAST(@DatabaseID AS NVARCHAR(10)) + N', NULL, NULL,NULL) AS os ON - ps.object_id=os.object_id and ps.index_id=os.index_id and ps.partition_number=os.partition_number OUTER APPLY (SELECT st.lock_escalation_desc FROM ' + QUOTENAME(@DatabaseName) + N'.sys.tables st WHERE st.object_id = ps.object_id @@ -21582,7 +21636,75 @@ BEGIN TRY le.lock_escalation_desc, ' + CASE WHEN @SQLServerProductVersion NOT LIKE '9%' THEN N'par.data_compression_desc ' ELSE N'null as data_compression_desc ' END + N' ORDER BY ps.object_id, ps.index_id, ps.partition_number - OPTION ( RECOMPILE ); + /*OPTION ( RECOMPILE );*/ + OPTION ( RECOMPILE , min_grant_percent = 1); + + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''start getting data into #dm_db_index_operational_stats at %s.'',0,1, @d) WITH NOWAIT; + + insert into #dm_db_index_operational_stats + ( + database_id + , object_id + , index_id + , partition_number + , hobt_id + , leaf_insert_count + , leaf_delete_count + , leaf_update_count + , range_scan_count + , singleton_lookup_count + , forwarded_fetch_count + , lob_fetch_in_pages + , lob_fetch_in_bytes + , row_overflow_fetch_in_pages + , row_overflow_fetch_in_bytes + , row_lock_count + , row_lock_wait_count + , row_lock_wait_in_ms + , page_lock_count + , page_lock_wait_count + , page_lock_wait_in_ms + , index_lock_promotion_attempt_count + , index_lock_promotion_count + , page_latch_wait_count + , page_latch_wait_in_ms + , page_io_latch_wait_count + , page_io_latch_wait_in_ms + ) + + select os.database_id + , os.object_id + , os.index_id + , os.partition_number + , os.hobt_id + , os.leaf_insert_count + , os.leaf_delete_count + , os.leaf_update_count + , os.range_scan_count + , os.singleton_lookup_count + , os.forwarded_fetch_count + , os.lob_fetch_in_pages + , os.lob_fetch_in_bytes + , os.row_overflow_fetch_in_pages + , os.row_overflow_fetch_in_bytes + , os.row_lock_count + , os.row_lock_wait_count + , os.row_lock_wait_in_ms + , os.page_lock_count + , os.page_lock_wait_count + , os.page_lock_wait_in_ms + , os.index_lock_promotion_attempt_count + , os.index_lock_promotion_count + , os.page_latch_wait_count + , os.page_latch_wait_in_ms + , os.page_io_latch_wait_count + , os.page_io_latch_wait_in_ms + from ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_index_operational_stats('+ CAST(@DatabaseID AS NVARCHAR(10)) +', NULL, NULL,NULL) AS os + OPTION ( RECOMPILE , min_grant_percent = 1); + + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121) + RAISERROR (N''finished getting data into #dm_db_index_operational_stats at %s.'',0,1, @d) WITH NOWAIT; '; END; ELSE @@ -21681,6 +21803,7 @@ BEGIN TRY PRINT SUBSTRING(@dsql, 32000, 36000); PRINT SUBSTRING(@dsql, 36000, 40000); END; + EXEC sp_executesql @dsql; INSERT #IndexPartitionSanity ( [database_id], [object_id], [schema_name], @@ -21715,8 +21838,35 @@ BEGIN TRY page_io_latch_wait_count, page_io_latch_wait_in_ms, reserved_dictionary_MB) - EXEC sp_executesql @dsql; - + select h.database_id, h.object_id, h.sname, h.index_id, h.partition_number, h.row_count, h.reserved_MB, h.reserved_LOB_MB, h.reserved_row_overflow_MB, h.lock_escalation_desc, h.data_compression_desc, + SUM(os.leaf_insert_count), + SUM(os.leaf_delete_count), + SUM(os.leaf_update_count), + SUM(os.range_scan_count), + SUM(os.singleton_lookup_count), + SUM(os.forwarded_fetch_count), + SUM(os.lob_fetch_in_pages), + SUM(os.lob_fetch_in_bytes), + SUM(os.row_overflow_fetch_in_pages), + SUM(os.row_overflow_fetch_in_bytes), + SUM(os.row_lock_count), + SUM(os.row_lock_wait_count), + SUM(os.row_lock_wait_in_ms), + SUM(os.page_lock_count), + SUM(os.page_lock_wait_count), + SUM(os.page_lock_wait_in_ms), + SUM(os.index_lock_promotion_attempt_count), + SUM(os.index_lock_promotion_count), + SUM(os.page_latch_wait_count), + SUM(os.page_latch_wait_in_ms), + SUM(os.page_io_latch_wait_count), + SUM(os.page_io_latch_wait_in_ms) + ,COALESCE((SELECT SUM (dict.on_disk_size / 1024.0 / 1024) FROM sys.column_store_dictionaries dict WHERE dict.partition_id = h.partition_id),0) AS reserved_dictionary_MB + from #dm_db_partition_stats_etc h + left JOIN #dm_db_index_operational_stats as os ON + h.object_id=os.object_id and h.index_id=os.index_id and h.partition_number=os.partition_number + group by h.database_id, h.object_id, h.sname, h.index_id, h.partition_number, h.partition_id, h.row_count, h.reserved_MB, h.reserved_LOB_MB, h.reserved_row_overflow_MB, h.lock_escalation_desc, h.data_compression_desc + END; --End Check For @SkipPartitions = 0 @@ -23067,7 +23217,7 @@ BEGIN INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.columns c ON rg.object_id = c.object_id INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partitions p ON rg.object_id = p.object_id AND rg.partition_number = p.partition_number INNER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.index_columns ic on ic.column_id = c.column_id AND ic.object_id = c.object_id AND ic.index_id = p.index_id - LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_column_store_row_group_physical_stats phys ON rg.row_group_id = phys.row_group_id AND rg.object_id = phys.object_id AND rg.partition_number = phys.partition_number AND p.index_id = phys.index_id ' + CASE WHEN @ShowPartitionRanges = 1 THEN N' + LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.dm_db_column_store_row_group_physical_stats phys ON rg.row_group_id = phys.row_group_id AND rg.object_id = phys.object_id AND rg.partition_number = phys.partition_number AND rg.index_id = phys.index_id ' + CASE WHEN @ShowPartitionRanges = 1 THEN N' LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.indexes i ON i.object_id = rg.object_id AND i.index_id = rg.index_id LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partition_schemes ps ON ps.data_space_id = i.data_space_id LEFT OUTER JOIN ' + QUOTENAME(@DatabaseName) + N'.sys.partition_functions pf ON pf.function_id = ps.function_id @@ -26254,7 +26404,8 @@ BEGIN END; /* End @Mode=3 (index detail)*/ - + SET @d = CONVERT(VARCHAR(19), GETDATE(), 121); + RAISERROR (N'finishing at %s',0,1, @d) WITH NOWAIT; END /* End @TableName IS NULL (mode 0/1/2/3/4) */ END TRY @@ -26312,7 +26463,7 @@ BEGIN SET XACT_ABORT OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF @VersionCheckMode = 1 BEGIN @@ -30467,7 +30618,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN RETURN; @@ -36516,7 +36667,7 @@ BEGIN SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN @@ -37912,6 +38063,8 @@ DELETE FROM dbo.SqlServerVersions; INSERT INTO dbo.SqlServerVersions (MajorVersionNumber, MinorVersionNumber, Branch, [Url], ReleaseDate, MainstreamSupportEndDate, ExtendedSupportEndDate, MajorVersionName, MinorVersionName) VALUES + (16, 4105, 'CU11', 'https://support.microsoft.com/en-us/help/5032679', '2024-01-11', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 11'), + (16, 4100, 'CU10 GDR', 'https://support.microsoft.com/en-us/help/5033592', '2024-01-09', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 10 GDR'), (16, 4095, 'CU10', 'https://support.microsoft.com/en-us/help/5031778', '2023-11-16', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 10'), (16, 4085, 'CU9', 'https://support.microsoft.com/en-us/help/5030731', '2023-10-12', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 9'), (16, 4075, 'CU8', 'https://support.microsoft.com/en-us/help/5029666', '2023-09-14', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 8'), @@ -37924,6 +38077,7 @@ VALUES (16, 4003, 'CU1', 'https://support.microsoft.com/en-us/help/5022375', '2023-02-16', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 1'), (16, 1050, 'RTM GDR', 'https://support.microsoft.com/kb/5021522', '2023-02-14', '2028-01-11', '2033-01-11', 'SQL Server 2022 GDR', 'RTM'), (16, 1000, 'RTM', '', '2022-11-15', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'RTM'), + (15, 4355, 'CU25', 'https://support.microsoft.com/kb/5033688', '2023-02-15', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 25'), (15, 4345, 'CU24', 'https://support.microsoft.com/kb/5031908', '2023-12-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 24'), (15, 4335, 'CU23', 'https://support.microsoft.com/kb/5030333', '2023-10-12', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 23'), (15, 4322, 'CU22', 'https://support.microsoft.com/kb/5027702', '2023-08-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 22'), @@ -38351,7 +38505,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_AllNightLog.sql b/sp_AllNightLog.sql index 1e7b1ddd..e886de70 100644 --- a/sp_AllNightLog.sql +++ b/sp_AllNightLog.sql @@ -31,7 +31,7 @@ SET STATISTICS XML OFF; BEGIN; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_AllNightLog_Setup.sql b/sp_AllNightLog_Setup.sql index 8238c897..0925414d 100644 --- a/sp_AllNightLog_Setup.sql +++ b/sp_AllNightLog_Setup.sql @@ -38,7 +38,7 @@ SET STATISTICS XML OFF; BEGIN; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_Blitz.sql b/sp_Blitz.sql index 9c3069b0..b1304b84 100644 --- a/sp_Blitz.sql +++ b/sp_Blitz.sql @@ -38,7 +38,7 @@ AS SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) diff --git a/sp_BlitzAnalysis.sql b/sp_BlitzAnalysis.sql index f96c56b9..52256e65 100644 --- a/sp_BlitzAnalysis.sql +++ b/sp_BlitzAnalysis.sql @@ -37,7 +37,7 @@ AS SET NOCOUNT ON; SET STATISTICS XML OFF; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_BlitzBackups.sql b/sp_BlitzBackups.sql index b11b48d2..8fc7fa29 100755 --- a/sp_BlitzBackups.sql +++ b/sp_BlitzBackups.sql @@ -24,7 +24,7 @@ AS SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_BlitzCache.sql b/sp_BlitzCache.sql index 3279e178..4b5ec1a4 100644 --- a/sp_BlitzCache.sql +++ b/sp_BlitzCache.sql @@ -281,7 +281,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) diff --git a/sp_BlitzFirst.sql b/sp_BlitzFirst.sql index 3b1624e6..fed15f31 100644 --- a/sp_BlitzFirst.sql +++ b/sp_BlitzFirst.sql @@ -47,7 +47,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_BlitzInMemoryOLTP.sql b/sp_BlitzInMemoryOLTP.sql index fc56a3cc..fd622d9f 100644 --- a/sp_BlitzInMemoryOLTP.sql +++ b/sp_BlitzInMemoryOLTP.sql @@ -82,7 +82,7 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ AS DECLARE @ScriptVersion VARCHAR(30); -SELECT @ScriptVersion = '1.8', @VersionDate = '20231222'; +SELECT @ScriptVersion = '1.8', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_BlitzIndex.sql b/sp_BlitzIndex.sql index a3409527..131c3155 100644 --- a/sp_BlitzIndex.sql +++ b/sp_BlitzIndex.sql @@ -48,7 +48,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; SET @OutputType = UPPER(@OutputType); IF(@VersionCheckMode = 1) diff --git a/sp_BlitzLock.sql b/sp_BlitzLock.sql index 848a324c..313887b9 100644 --- a/sp_BlitzLock.sql +++ b/sp_BlitzLock.sql @@ -36,7 +36,7 @@ BEGIN SET XACT_ABORT OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF @VersionCheckMode = 1 BEGIN diff --git a/sp_BlitzQueryStore.sql b/sp_BlitzQueryStore.sql index 084e988f..991a7dec 100644 --- a/sp_BlitzQueryStore.sql +++ b/sp_BlitzQueryStore.sql @@ -57,7 +57,7 @@ SET NOCOUNT ON; SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN RETURN; diff --git a/sp_BlitzWho.sql b/sp_BlitzWho.sql index d623706c..a6728be9 100644 --- a/sp_BlitzWho.sql +++ b/sp_BlitzWho.sql @@ -33,7 +33,7 @@ BEGIN SET STATISTICS XML OFF; SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_DatabaseRestore.sql b/sp_DatabaseRestore.sql index 0f16b614..43805aee 100755 --- a/sp_DatabaseRestore.sql +++ b/sp_DatabaseRestore.sql @@ -47,7 +47,7 @@ SET STATISTICS XML OFF; /*Versioning details*/ -SELECT @Version = '8.18', @VersionDate = '20231222'; +SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN diff --git a/sp_ineachdb.sql b/sp_ineachdb.sql index 9cf874ba..06c84e07 100644 --- a/sp_ineachdb.sql +++ b/sp_ineachdb.sql @@ -36,7 +36,7 @@ BEGIN SET NOCOUNT ON; SET STATISTICS XML OFF; - SELECT @Version = '8.18', @VersionDate = '20231222'; + SELECT @Version = '8.19', @VersionDate = '20240222'; IF(@VersionCheckMode = 1) BEGIN