Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

2024-12-28 Release #3602

Merged
merged 16 commits into from
Dec 28, 2024
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: 265.
If you want to add a new one, start at 266.
CURRENT HIGH CHECKID: 266.
If you want to add a new one, start at 267.

| Priority | FindingsGroup | Finding | URL | CheckID |
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
Expand Down Expand Up @@ -301,6 +301,7 @@ If you want to add a new one, start at 266.
| 250 | Server Info | Drive Space | | 92 |
| 250 | Server Info | Full-text Filter Daemon is Currently Offline | | 168 |
| 250 | Server Info | Hardware | | 84 |
| 250 | Server Info | Hardware - Memory Counters | https://www.BrentOzar.com/go/target | 266 |
| 250 | Server Info | Hardware - NUMA Config | | 114 |
| 250 | Server Info | Instant File Initialization Enabled | https://www.BrentOzar.com/go/instant | 193 |
| 250 | Server Info | Locked Pages in Memory Enabled | https://www.BrentOzar.com/go/lpim | 166 |
Expand Down
76 changes: 58 additions & 18 deletions Install-All-Scripts.sql
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ AS
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;


SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down Expand Up @@ -287,8 +287,8 @@ AS
(
SELECT
1/0
FROM fn_my_permissions(N'sys.traces', N'OBJECT') AS fmp
WHERE fmp.permission_name = N'ALTER'
FROM fn_my_permissions(NULL, NULL) AS fmp
WHERE fmp.permission_name = N'ALTER TRACE'
)
BEGIN
SET @SkipTrace = 1;
Expand Down Expand Up @@ -7049,7 +7049,7 @@ IF @ProductVersionMajor >= 10
''File Configuration'' AS FindingsGroup,
''File growth set to percent'',
''https://www.brentozar.com/go/percentgrowth'' AS URL,
''The ['' + DB_NAME() + ''] database file '' + f.physical_name + '' has grown to '' + CONVERT(NVARCHAR(10), CONVERT(NUMERIC(38, 2), (f.size / 128.) / 1024.)) + '' GB, and is using percent filegrowth settings. This can lead to slow performance during growths if Instant File Initialization is not enabled.''
''The ['' + DB_NAME() + ''] database file '' + f.physical_name + '' has grown to '' + CONVERT(NVARCHAR(20), CONVERT(NUMERIC(38, 2), (f.size / 128.) / 1024.)) + '' GB, and is using percent filegrowth settings. This can lead to slow performance during growths if Instant File Initialization is not enabled.''
FROM [?].sys.database_files f
WHERE is_percent_growth = 1 and size > 128000 OPTION (RECOMPILE);';
END;
Expand Down Expand Up @@ -8617,7 +8617,7 @@ IF @ProductVersionMajor >= 10
SELECT 162 AS CheckID ,
50 AS Priority ,
'Performance' AS FindingGroup ,
'Poison Wait Detected: CMEMTHREAD & NUMA' AS Finding ,
'Poison Wait Detected: CMEMTHREAD and NUMA' AS Finding ,
'https://www.brentozar.com/go/poison' AS URL ,
CONVERT(VARCHAR(10), (MAX([wait_time_ms]) / 1000) / 86400) + ':' + CONVERT(VARCHAR(20), DATEADD(s, (MAX([wait_time_ms]) / 1000), 0), 108) + ' of this wait have been recorded'
+ CASE WHEN ts.status = 1 THEN ' despite enabling trace flag 8048 already.'
Expand Down Expand Up @@ -9970,6 +9970,36 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1
END;
END; /* CheckID 261 */


IF NOT EXISTS ( SELECT 1
FROM #SkipChecks
WHERE DatabaseName IS NULL AND CheckID = 266 )
BEGIN
INSERT INTO #BlitzResults
( CheckID ,
Priority ,
FindingsGroup ,
Finding ,
URL ,
Details
)
SELECT 266 AS CheckID ,
250 AS Priority ,
'Server Info' AS FindingsGroup ,
'Hardware - Memory Counters' AS Finding ,
'https://www.brentozar.com/go/target' AS URL ,
N'Target Server Memory (GB): ' + CAST((CAST((pTarget.cntr_value / 1024.0 / 1024.0) AS DECIMAL(10,1))) AS NVARCHAR(100))
+ N' Total Server Memory (GB): ' + CAST((CAST((pTotal.cntr_value / 1024.0 / 1024.0) AS DECIMAL(10,1))) AS NVARCHAR(100))
FROM sys.dm_os_performance_counters pTarget
INNER JOIN sys.dm_os_performance_counters pTotal
ON pTotal.object_name LIKE 'SQLServer:Memory Manager%'
AND pTotal.counter_name LIKE 'Total Server Memory (KB)%'
WHERE pTarget.object_name LIKE 'SQLServer:Memory Manager%'
AND pTarget.counter_name LIKE 'Target Server Memory (KB)%'
END



END; /* IF @CheckServerInfo = 1 */
END; /* IF ( ( SERVERPROPERTY('ServerName') NOT IN ( SELECT ServerName */

Expand Down Expand Up @@ -10535,7 +10565,7 @@ AS
SET NOCOUNT ON;
SET STATISTICS XML OFF;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down Expand Up @@ -11413,7 +11443,7 @@ AS
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down Expand Up @@ -13195,7 +13225,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down Expand Up @@ -20534,6 +20564,7 @@ IF OBJECT_ID('dbo.sp_BlitzIndex') IS NULL
GO

ALTER PROCEDURE dbo.sp_BlitzIndex
@ObjectName NVARCHAR(386) = NULL, /* 'dbname.schema.table' -- if you are lazy and want to fill in @DatabaseName, @SchemaName and @TableName, and since it's the first parameter can simply do: sp_BlitzIndex 'sch.table' */
@DatabaseName NVARCHAR(128) = NULL, /*Defaults to current DB if not specified*/
@SchemaName NVARCHAR(128) = NULL, /*Requires table_name as well.*/
@TableName NVARCHAR(128) = NULL, /*Requires schema_name as well.*/
Expand Down Expand Up @@ -20569,7 +20600,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down Expand Up @@ -20653,6 +20684,11 @@ DECLARE @PartitionCount INT;
DECLARE @OptimizeForSequentialKey BIT = 0;
DECLARE @StringToExecute NVARCHAR(MAX);

/* If user was lazy and just used @ObjectName with a fully qualified table name, then lets parse out the various parts */
SET @DatabaseName = COALESCE(@DatabaseName, PARSENAME(@ObjectName, 3)) /* 3 = Database name */
SET @SchemaName = COALESCE(@SchemaName, PARSENAME(@ObjectName, 2)) /* 2 = Schema name */
SET @TableName = COALESCE(@TableName, PARSENAME(@ObjectName, 1)) /* 1 = Table name */


/* Let's get @SortOrder set to lower case here for comparisons later */
SET @SortOrder = REPLACE(LOWER(@SortOrder), N' ', N'_');
Expand Down Expand Up @@ -21977,9 +22013,9 @@ BEGIN TRY
, partition_number int
, partition_id bigint
, row_count bigint
, reserved_MB bigint
, reserved_LOB_MB bigint
, reserved_row_overflow_MB bigint
, reserved_MB NUMERIC(29,2)
, reserved_LOB_MB NUMERIC(29,2)
, reserved_row_overflow_MB NUMERIC(29,2)
, lock_escalation_desc nvarchar(60)
, data_compression_desc nvarchar(60)
)
Expand Down Expand Up @@ -23475,7 +23511,6 @@ BEGIN
SELECT '#MissingIndexes' AS table_name, * FROM #MissingIndexes;
SELECT '#ForeignKeys' AS table_name, * FROM #ForeignKeys;
SELECT '#UnindexedForeignKeys' AS table_name, * FROM #UnindexedForeignKeys;
SELECT '#BlitzIndexResults' AS table_name, * FROM #BlitzIndexResults;
SELECT '#IndexCreateTsql' AS table_name, * FROM #IndexCreateTsql;
SELECT '#DatabaseList' AS table_name, * FROM #DatabaseList;
SELECT '#Statistics' AS table_name, * FROM #Statistics;
Expand Down Expand Up @@ -27065,7 +27100,7 @@ BEGIN
SET XACT_ABORT OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF @VersionCheckMode = 1
BEGIN
Expand Down Expand Up @@ -31230,7 +31265,7 @@ BEGIN
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down Expand Up @@ -32643,7 +32678,7 @@ SET STATISTICS XML OFF;

/*Versioning details*/

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down Expand Up @@ -34312,7 +34347,7 @@ BEGIN
SET NOCOUNT ON;
SET STATISTICS XML OFF;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down Expand Up @@ -34675,6 +34710,7 @@ INSERT INTO dbo.SqlServerVersions
(MajorVersionNumber, MinorVersionNumber, Branch, [Url], ReleaseDate, MainstreamSupportEndDate, ExtendedSupportEndDate, MajorVersionName, MinorVersionName)
VALUES
/*2022*/
(16, 4165, 'CU16', 'https://support.microsoft.com/en-us/help/5048033', '2024-11-14', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 16'),
(16, 4150, 'CU15 GDR', 'https://support.microsoft.com/en-us/help/5046059', '2024-10-08', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 15 GDR'),
(16, 4145, 'CU15', 'https://support.microsoft.com/en-us/help/5041321', '2024-09-25', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 15'),
(16, 4140, 'CU14 GDR', 'https://support.microsoft.com/en-us/help/5042578', '2024-09-10', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'Cumulative Update 14 GDR'),
Expand All @@ -34696,6 +34732,8 @@ VALUES
(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'),
/*2019*/
(15, 4415, 'CU30', 'https://support.microsoft.com/kb/5049235', '2024-12-13', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 30'),
(15, 4405, 'CU29', 'https://support.microsoft.com/kb/5046365', '2024-10-31', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 29'),
(15, 4395, 'CU28 GDR', 'https://support.microsoft.com/kb/5046060', '2024-10-08', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 28 GDR'),
(15, 4390, 'CU28 GDR', 'https://support.microsoft.com/kb/5042749', '2024-09-10', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 28 GDR'),
(15, 4385, 'CU28', 'https://support.microsoft.com/kb/5039747', '2024-08-01', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 28'),
Expand Down Expand Up @@ -34732,6 +34770,7 @@ VALUES
(15, 2070, 'GDR', 'https://support.microsoft.com/en-us/help/4517790', '2019-11-04', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'RTM GDR '),
(15, 2000, 'RTM ', '', '2019-11-04', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'RTM '),
/*2017*/
(14, 3485, 'RTM CU31 GDR', 'https://support.microsoft.com/kb/5046858', '2024-11-12', '2022-10-11', '2027-10-12', 'SQL Server 2017', 'RTM Cumulative Update 31 GDR'),
(14, 3480, 'RTM CU31 GDR', 'https://support.microsoft.com/kb/5046061', '2024-10-08', '2022-10-11', '2027-10-12', 'SQL Server 2017', 'RTM Cumulative Update 31 GDR'),
(14, 3475, 'RTM CU31 GDR', 'https://support.microsoft.com/kb/5042215', '2024-09-10', '2022-10-11', '2027-10-12', 'SQL Server 2017', 'RTM Cumulative Update 31 GDR'),
(14, 3471, 'RTM CU31 GDR', 'https://support.microsoft.com/kb/5040940', '2024-07-09', '2022-10-11', '2027-10-12', 'SQL Server 2017', 'RTM Cumulative Update 31 GDR'),
Expand Down Expand Up @@ -34779,6 +34818,7 @@ VALUES
(13, 7024, 'SP3 Azure Feature Pack GDR', 'https://support.microsoft.com/en-us/help/5021128', '2023-02-14', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 3 Azure Feature Pack GDR'),
(13, 7016, 'SP3 Azure Feature Pack GDR', 'https://support.microsoft.com/en-us/help/5015371', '2022-06-14', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 3 Azure Feature Pack GDR'),
(13, 7000, 'SP3 Azure Feature Pack', 'https://support.microsoft.com/en-us/help/5014242', '2022-05-19', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 3 Azure Feature Pack'),
(13, 6455, 'SP3 GDR', 'https://support.microsoft.com/kb/5046855', '2024-11-12', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 3 GDR'),
(13, 6450, 'SP3 GDR', 'https://support.microsoft.com/kb/5046063', '2024-10-08', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 3 GDR'),
(13, 6445, 'SP3 GDR', 'https://support.microsoft.com/kb/5042207', '2024-09-10', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 3 GDR'),
(13, 6441, 'SP3 GDR', 'https://support.microsoft.com/kb/5040946', '2024-07-09', '2021-07-13', '2026-07-14', 'SQL Server 2016', 'Service Pack 3 GDR'),
Expand Down Expand Up @@ -35149,7 +35189,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
25 changes: 15 additions & 10 deletions Install-Azure.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ AS
SET NOCOUNT ON;
SET STATISTICS XML OFF;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down Expand Up @@ -1172,7 +1172,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down Expand Up @@ -8545,7 +8545,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down Expand Up @@ -13519,6 +13519,7 @@ IF OBJECT_ID('dbo.sp_BlitzIndex') IS NULL
GO

ALTER PROCEDURE dbo.sp_BlitzIndex
@ObjectName NVARCHAR(386) = NULL, /* 'dbname.schema.table' -- if you are lazy and want to fill in @DatabaseName, @SchemaName and @TableName, and since it's the first parameter can simply do: sp_BlitzIndex 'sch.table' */
@DatabaseName NVARCHAR(128) = NULL, /*Defaults to current DB if not specified*/
@SchemaName NVARCHAR(128) = NULL, /*Requires table_name as well.*/
@TableName NVARCHAR(128) = NULL, /*Requires schema_name as well.*/
Expand Down Expand Up @@ -13554,7 +13555,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down Expand Up @@ -13638,6 +13639,11 @@ DECLARE @PartitionCount INT;
DECLARE @OptimizeForSequentialKey BIT = 0;
DECLARE @StringToExecute NVARCHAR(MAX);

/* If user was lazy and just used @ObjectName with a fully qualified table name, then lets parse out the various parts */
SET @DatabaseName = COALESCE(@DatabaseName, PARSENAME(@ObjectName, 3)) /* 3 = Database name */
SET @SchemaName = COALESCE(@SchemaName, PARSENAME(@ObjectName, 2)) /* 2 = Schema name */
SET @TableName = COALESCE(@TableName, PARSENAME(@ObjectName, 1)) /* 1 = Table name */


/* Let's get @SortOrder set to lower case here for comparisons later */
SET @SortOrder = REPLACE(LOWER(@SortOrder), N' ', N'_');
Expand Down Expand Up @@ -14962,9 +14968,9 @@ BEGIN TRY
, partition_number int
, partition_id bigint
, row_count bigint
, reserved_MB bigint
, reserved_LOB_MB bigint
, reserved_row_overflow_MB bigint
, reserved_MB NUMERIC(29,2)
, reserved_LOB_MB NUMERIC(29,2)
, reserved_row_overflow_MB NUMERIC(29,2)
, lock_escalation_desc nvarchar(60)
, data_compression_desc nvarchar(60)
)
Expand Down Expand Up @@ -16460,7 +16466,6 @@ BEGIN
SELECT '#MissingIndexes' AS table_name, * FROM #MissingIndexes;
SELECT '#ForeignKeys' AS table_name, * FROM #ForeignKeys;
SELECT '#UnindexedForeignKeys' AS table_name, * FROM #UnindexedForeignKeys;
SELECT '#BlitzIndexResults' AS table_name, * FROM #BlitzIndexResults;
SELECT '#IndexCreateTsql' AS table_name, * FROM #IndexCreateTsql;
SELECT '#DatabaseList' AS table_name, * FROM #DatabaseList;
SELECT '#Statistics' AS table_name, * FROM #Statistics;
Expand Down Expand Up @@ -20050,7 +20055,7 @@ BEGIN
SET XACT_ABORT OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF @VersionCheckMode = 1
BEGIN
Expand Down Expand Up @@ -24215,7 +24220,7 @@ BEGIN
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.22', @VersionDate = '20241019';
SELECT @Version = '8.23', @VersionDate = '20241228';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
Loading
Loading