Skip to content

Commit

Permalink
Merge pull request BrentOzarULTD#3549 from BrentOzarULTD/20240701_rel…
Browse files Browse the repository at this point in the history
…ease

2024-07-01 Release
  • Loading branch information
BrentOzar authored Jul 1, 2024
2 parents 5cbd9a6 + af04839 commit 39f26d8
Show file tree
Hide file tree
Showing 13 changed files with 499 additions and 327 deletions.
690 changes: 418 additions & 272 deletions Install-All-Scripts.sql

Large diffs are not rendered by default.

115 changes: 70 additions & 45 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.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

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.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';
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.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

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

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down Expand Up @@ -20029,6 +20029,7 @@ ALTER PROCEDURE
@EventSessionName sysname = N'system_health',
@TargetSessionType sysname = NULL,
@VictimsOnly bit = 0,
@DeadlockType nvarchar(20) = NULL,
@Debug bit = 0,
@Help bit = 0,
@Version varchar(30) = NULL OUTPUT,
Expand All @@ -20047,7 +20048,7 @@ BEGIN
SET XACT_ABORT OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF @VersionCheckMode = 1
BEGIN
Expand Down Expand Up @@ -20209,7 +20210,7 @@ BEGIN
@StartDateOriginal datetime = @StartDate,
@EndDateOriginal datetime = @EndDate,
@StartDateUTC datetime,
@EndDateUTC datetime;
@EndDateUTC datetime;;

/*Temporary objects used in the procedure*/
DECLARE
Expand Down Expand Up @@ -20719,50 +20720,63 @@ BEGIN
END CATCH;
END;

IF @DeadlockType IS NOT NULL
BEGIN
SELECT
@DeadlockType =
CASE
WHEN LOWER(@DeadlockType) LIKE 'regular%'
THEN N'Regular Deadlock'
WHEN LOWER(@DeadlockType) LIKE N'parallel%'
THEN N'Parallel Deadlock'
ELSE NULL
END;
END;

/*If @TargetSessionType, we need to figure out if it's ring buffer or event file*/
/*Azure has differently named views, so we need to separate. Thanks, Azure.*/

IF
(
@Azure = 0
AND @TargetSessionType IS NULL
)
BEGIN
RAISERROR('@TargetSessionType is NULL, assigning for non-Azure instance', 0, 1) WITH NOWAIT;
IF
(
@Azure = 0
AND @TargetSessionType IS NULL
)
BEGIN
RAISERROR('@TargetSessionType is NULL, assigning for non-Azure instance', 0, 1) WITH NOWAIT;

SELECT TOP (1)
@TargetSessionType = t.target_name
FROM sys.dm_xe_sessions AS s
JOIN sys.dm_xe_session_targets AS t
ON s.address = t.event_session_address
WHERE s.name = @EventSessionName
AND t.target_name IN (N'event_file', N'ring_buffer')
ORDER BY t.target_name
OPTION(RECOMPILE);
SELECT TOP (1)
@TargetSessionType = t.target_name
FROM sys.dm_xe_sessions AS s
JOIN sys.dm_xe_session_targets AS t
ON s.address = t.event_session_address
WHERE s.name = @EventSessionName
AND t.target_name IN (N'event_file', N'ring_buffer')
ORDER BY t.target_name
OPTION(RECOMPILE);

RAISERROR('@TargetSessionType assigned as %s for non-Azure', 0, 1, @TargetSessionType) WITH NOWAIT;
END;
RAISERROR('@TargetSessionType assigned as %s for non-Azure', 0, 1, @TargetSessionType) WITH NOWAIT;
END;

IF
(
@Azure = 1
AND @TargetSessionType IS NULL
)
BEGIN
RAISERROR('@TargetSessionType is NULL, assigning for Azure instance', 0, 1) WITH NOWAIT;
IF
(
@Azure = 1
AND @TargetSessionType IS NULL
)
BEGIN
RAISERROR('@TargetSessionType is NULL, assigning for Azure instance', 0, 1) WITH NOWAIT;

SELECT TOP (1)
@TargetSessionType = t.target_name
FROM sys.dm_xe_database_sessions AS s
JOIN sys.dm_xe_database_session_targets AS t
ON s.address = t.event_session_address
WHERE s.name = @EventSessionName
AND t.target_name IN (N'event_file', N'ring_buffer')
ORDER BY t.target_name
OPTION(RECOMPILE);
SELECT TOP (1)
@TargetSessionType = t.target_name
FROM sys.dm_xe_database_sessions AS s
JOIN sys.dm_xe_database_session_targets AS t
ON s.address = t.event_session_address
WHERE s.name = @EventSessionName
AND t.target_name IN (N'event_file', N'ring_buffer')
ORDER BY t.target_name
OPTION(RECOMPILE);

RAISERROR('@TargetSessionType assigned as %s for Azure', 0, 1, @TargetSessionType) WITH NOWAIT;
END;
RAISERROR('@TargetSessionType assigned as %s for Azure', 0, 1, @TargetSessionType) WITH NOWAIT;
END;


/*The system health stuff gets handled different from user extended events.*/
Expand Down Expand Up @@ -23460,6 +23474,7 @@ BEGIN
AND (d.client_app = @AppName OR @AppName IS NULL)
AND (d.host_name = @HostName OR @HostName IS NULL)
AND (d.login_name = @LoginName OR @LoginName IS NULL)
AND (d.deadlock_type = @DeadlockType OR @DeadlockType IS NULL)
OPTION (RECOMPILE, LOOP JOIN, HASH JOIN);

UPDATE d
Expand Down Expand Up @@ -23847,7 +23862,11 @@ BEGIN
deqs.max_reserved_threads,
deqs.min_used_threads,
deqs.max_used_threads,
deqs.total_rows
deqs.total_rows,
max_worker_time_ms =
deqs.max_worker_time / 1000.,
max_elapsed_time_ms =
deqs.max_elapsed_time / 1000.
INTO #dm_exec_query_stats
FROM sys.dm_exec_query_stats AS deqs
WHERE EXISTS
Expand Down Expand Up @@ -23879,8 +23898,10 @@ BEGIN
ap.executions_per_second,
ap.total_worker_time_ms,
ap.avg_worker_time_ms,
ap.max_worker_time_ms,
ap.total_elapsed_time_ms,
ap.avg_elapsed_time_ms,
ap.max_elapsed_time_ms,
ap.total_logical_reads_mb,
ap.total_physical_reads_mb,
ap.total_logical_writes_mb,
Expand Down Expand Up @@ -23923,7 +23944,9 @@ BEGIN
c.min_used_threads,
c.max_used_threads,
c.total_rows,
c.query_plan
c.query_plan,
c.max_worker_time_ms,
c.max_elapsed_time_ms
FROM #available_plans AS ap
OUTER APPLY
(
Expand Down Expand Up @@ -24074,6 +24097,8 @@ BEGIN
@TargetSessionType,
VictimsOnly =
@VictimsOnly,
DeadlockType =
@DeadlockType,
Debug =
@Debug,
Help =
Expand Down Expand Up @@ -24178,7 +24203,7 @@ BEGIN
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
1 change: 1 addition & 0 deletions SqlServerVersions.sql
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,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, 4375, 'CU27', 'https://support.microsoft.com/kb/5037331', '2024-06-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 27'),
(15, 4365, 'CU26', 'https://support.microsoft.com/kb/5035123', '2024-04-11', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 26'),
(15, 4355, 'CU25', 'https://support.microsoft.com/kb/5033688', '2024-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'),
Expand Down
2 changes: 1 addition & 1 deletion sp_Blitz.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.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down
2 changes: 1 addition & 1 deletion sp_BlitzAnalysis.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.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
2 changes: 1 addition & 1 deletion sp_BlitzBackups.sql
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ AS
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
2 changes: 1 addition & 1 deletion sp_BlitzCache.sql
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down
2 changes: 1 addition & 1 deletion sp_BlitzFirst.sql
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
2 changes: 1 addition & 1 deletion sp_BlitzIndex.sql
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ SET NOCOUNT ON;
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';
SET @OutputType = UPPER(@OutputType);

IF(@VersionCheckMode = 1)
Expand Down
2 changes: 1 addition & 1 deletion sp_BlitzLock.sql
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ BEGIN
SET XACT_ABORT OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF @VersionCheckMode = 1
BEGIN
Expand Down
2 changes: 1 addition & 1 deletion sp_BlitzWho.sql
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ BEGIN
SET STATISTICS XML OFF;
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
2 changes: 1 addition & 1 deletion sp_DatabaseRestore.sql
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ SET STATISTICS XML OFF;

/*Versioning details*/

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down
2 changes: 1 addition & 1 deletion sp_ineachdb.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ BEGIN
SET NOCOUNT ON;
SET STATISTICS XML OFF;

SELECT @Version = '8.20', @VersionDate = '20240522';
SELECT @Version = '8.21', @VersionDate = '20240701';

IF(@VersionCheckMode = 1)
BEGIN
Expand Down

0 comments on commit 39f26d8

Please sign in to comment.