Skip to content

Commit 82e462d

Browse files
authored
Merge pull request #3550 from BrentOzarULTD/dev
2024-07-01 Release
2 parents 4e2cbda + 39f26d8 commit 82e462d

16 files changed

+917
-602
lines changed

Deprecated/readme.txt

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
1-
These old versions worked on SQL Server 2005.
1+
sp_AllNightLog, sp_AllNightLog_Setup, sp_BlitzInMemoryOLTP, and sp_BlitzQueryStore are no longer maintained. They may still work, but no guarantees. Please don't submit issues or pull requests to change them. You're welcome to fork the code and build your own supported version, of course, since they're open source.
22

3-
They are no longer maintained or updated.
4-
5-
Don't use 'em on SQL Server 2008 or newer - these are only for folks who still
6-
need to manage SQL Server 2005.
3+
The other files in this folder are older versions of the First Responder Kit that work with versions of Microsoft SQL Server that Microsoft themselves no longer support. If you're cursed enough to work with antiques like SQL Server 2012, 2008, or heaven forbid, 2005, you may still be able to get value out of these, but we don't support the scripts anymore either.

Documentation/sp_Blitz_Checks_by_Priority.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ Before adding a new check, make sure to add a Github issue for it first, and hav
66

77
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.
88

9-
CURRENT HIGH CHECKID: 261.
10-
If you want to add a new one, start at 262.
9+
CURRENT HIGH CHECKID: 264.
10+
If you want to add a new one, start at 265.
1111

1212
| Priority | FindingsGroup | Finding | URL | CheckID |
1313
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
@@ -247,6 +247,9 @@ If you want to add a new one, start at 262.
247247
| 200 | Performance | Non-Dynamic Memory | https://www.BrentOzar.com/go/memory | 190 |
248248
| 200 | Performance | Old Compatibility Level | https://www.BrentOzar.com/go/compatlevel | 62 |
249249
| 200 | Performance | Query Store Disabled | https://www.BrentOzar.com/go/querystore | 163 |
250+
| 200 | Performance | Query Store Wait Stats Disabled | https://www.sqlskills.com/blogs/erin/query-store-settings/ | 262 |
251+
| 200 | Performance | Query Store Effectively Disabled | https://learn.microsoft.com/en-us/sql/relational-databases/performance/best-practice-with-the-query-store#Verify | 263 |
252+
| 200 | Performance | Undesired Query Store State | https://learn.microsoft.com/en-us/sql/relational-databases/performance/best-practice-with-the-query-store#Verify | 264 |
250253
| 200 | Performance | Snapshot Backups Occurring | https://www.BrentOzar.com/go/snaps | 178 |
251254
| 200 | Performance | User-Created Statistics In Place | https://www.BrentOzar.com/go/userstats | 122 |
252255
| 200 | Performance | SSAS/SSIS/SSRS Installed | https://www.BrentOzar.com/go/services | 224 |

Install-All-Scripts.sql

Lines changed: 418 additions & 272 deletions
Large diffs are not rendered by default.

Install-Azure.sql

Lines changed: 70 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ AS
3737
SET NOCOUNT ON;
3838
SET STATISTICS XML OFF;
3939

40-
SELECT @Version = '8.20', @VersionDate = '20240522';
40+
SELECT @Version = '8.21', @VersionDate = '20240701';
4141

4242
IF(@VersionCheckMode = 1)
4343
BEGIN
@@ -1172,7 +1172,7 @@ SET NOCOUNT ON;
11721172
SET STATISTICS XML OFF;
11731173
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
11741174

1175-
SELECT @Version = '8.20', @VersionDate = '20240522';
1175+
SELECT @Version = '8.21', @VersionDate = '20240701';
11761176
SET @OutputType = UPPER(@OutputType);
11771177

11781178
IF(@VersionCheckMode = 1)
@@ -8545,7 +8545,7 @@ SET NOCOUNT ON;
85458545
SET STATISTICS XML OFF;
85468546
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
85478547

8548-
SELECT @Version = '8.20', @VersionDate = '20240522';
8548+
SELECT @Version = '8.21', @VersionDate = '20240701';
85498549

85508550
IF(@VersionCheckMode = 1)
85518551
BEGIN
@@ -13554,7 +13554,7 @@ SET NOCOUNT ON;
1355413554
SET STATISTICS XML OFF;
1355513555
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
1355613556

13557-
SELECT @Version = '8.20', @VersionDate = '20240522';
13557+
SELECT @Version = '8.21', @VersionDate = '20240701';
1355813558
SET @OutputType = UPPER(@OutputType);
1355913559

1356013560
IF(@VersionCheckMode = 1)
@@ -20029,6 +20029,7 @@ ALTER PROCEDURE
2002920029
@EventSessionName sysname = N'system_health',
2003020030
@TargetSessionType sysname = NULL,
2003120031
@VictimsOnly bit = 0,
20032+
@DeadlockType nvarchar(20) = NULL,
2003220033
@Debug bit = 0,
2003320034
@Help bit = 0,
2003420035
@Version varchar(30) = NULL OUTPUT,
@@ -20047,7 +20048,7 @@ BEGIN
2004720048
SET XACT_ABORT OFF;
2004820049
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
2004920050

20050-
SELECT @Version = '8.20', @VersionDate = '20240522';
20051+
SELECT @Version = '8.21', @VersionDate = '20240701';
2005120052

2005220053
IF @VersionCheckMode = 1
2005320054
BEGIN
@@ -20209,7 +20210,7 @@ BEGIN
2020920210
@StartDateOriginal datetime = @StartDate,
2021020211
@EndDateOriginal datetime = @EndDate,
2021120212
@StartDateUTC datetime,
20212-
@EndDateUTC datetime;
20213+
@EndDateUTC datetime;;
2021320214

2021420215
/*Temporary objects used in the procedure*/
2021520216
DECLARE
@@ -20719,50 +20720,63 @@ BEGIN
2071920720
END CATCH;
2072020721
END;
2072120722

20723+
IF @DeadlockType IS NOT NULL
20724+
BEGIN
20725+
SELECT
20726+
@DeadlockType =
20727+
CASE
20728+
WHEN LOWER(@DeadlockType) LIKE 'regular%'
20729+
THEN N'Regular Deadlock'
20730+
WHEN LOWER(@DeadlockType) LIKE N'parallel%'
20731+
THEN N'Parallel Deadlock'
20732+
ELSE NULL
20733+
END;
20734+
END;
20735+
2072220736
/*If @TargetSessionType, we need to figure out if it's ring buffer or event file*/
2072320737
/*Azure has differently named views, so we need to separate. Thanks, Azure.*/
2072420738

20725-
IF
20726-
(
20727-
@Azure = 0
20728-
AND @TargetSessionType IS NULL
20729-
)
20730-
BEGIN
20731-
RAISERROR('@TargetSessionType is NULL, assigning for non-Azure instance', 0, 1) WITH NOWAIT;
20739+
IF
20740+
(
20741+
@Azure = 0
20742+
AND @TargetSessionType IS NULL
20743+
)
20744+
BEGIN
20745+
RAISERROR('@TargetSessionType is NULL, assigning for non-Azure instance', 0, 1) WITH NOWAIT;
2073220746

20733-
SELECT TOP (1)
20734-
@TargetSessionType = t.target_name
20735-
FROM sys.dm_xe_sessions AS s
20736-
JOIN sys.dm_xe_session_targets AS t
20737-
ON s.address = t.event_session_address
20738-
WHERE s.name = @EventSessionName
20739-
AND t.target_name IN (N'event_file', N'ring_buffer')
20740-
ORDER BY t.target_name
20741-
OPTION(RECOMPILE);
20747+
SELECT TOP (1)
20748+
@TargetSessionType = t.target_name
20749+
FROM sys.dm_xe_sessions AS s
20750+
JOIN sys.dm_xe_session_targets AS t
20751+
ON s.address = t.event_session_address
20752+
WHERE s.name = @EventSessionName
20753+
AND t.target_name IN (N'event_file', N'ring_buffer')
20754+
ORDER BY t.target_name
20755+
OPTION(RECOMPILE);
2074220756

20743-
RAISERROR('@TargetSessionType assigned as %s for non-Azure', 0, 1, @TargetSessionType) WITH NOWAIT;
20744-
END;
20757+
RAISERROR('@TargetSessionType assigned as %s for non-Azure', 0, 1, @TargetSessionType) WITH NOWAIT;
20758+
END;
2074520759

20746-
IF
20747-
(
20748-
@Azure = 1
20749-
AND @TargetSessionType IS NULL
20750-
)
20751-
BEGIN
20752-
RAISERROR('@TargetSessionType is NULL, assigning for Azure instance', 0, 1) WITH NOWAIT;
20760+
IF
20761+
(
20762+
@Azure = 1
20763+
AND @TargetSessionType IS NULL
20764+
)
20765+
BEGIN
20766+
RAISERROR('@TargetSessionType is NULL, assigning for Azure instance', 0, 1) WITH NOWAIT;
2075320767

20754-
SELECT TOP (1)
20755-
@TargetSessionType = t.target_name
20756-
FROM sys.dm_xe_database_sessions AS s
20757-
JOIN sys.dm_xe_database_session_targets AS t
20758-
ON s.address = t.event_session_address
20759-
WHERE s.name = @EventSessionName
20760-
AND t.target_name IN (N'event_file', N'ring_buffer')
20761-
ORDER BY t.target_name
20762-
OPTION(RECOMPILE);
20768+
SELECT TOP (1)
20769+
@TargetSessionType = t.target_name
20770+
FROM sys.dm_xe_database_sessions AS s
20771+
JOIN sys.dm_xe_database_session_targets AS t
20772+
ON s.address = t.event_session_address
20773+
WHERE s.name = @EventSessionName
20774+
AND t.target_name IN (N'event_file', N'ring_buffer')
20775+
ORDER BY t.target_name
20776+
OPTION(RECOMPILE);
2076320777

20764-
RAISERROR('@TargetSessionType assigned as %s for Azure', 0, 1, @TargetSessionType) WITH NOWAIT;
20765-
END;
20778+
RAISERROR('@TargetSessionType assigned as %s for Azure', 0, 1, @TargetSessionType) WITH NOWAIT;
20779+
END;
2076620780

2076720781

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

2346523480
UPDATE d
@@ -23847,7 +23862,11 @@ BEGIN
2384723862
deqs.max_reserved_threads,
2384823863
deqs.min_used_threads,
2384923864
deqs.max_used_threads,
23850-
deqs.total_rows
23865+
deqs.total_rows,
23866+
max_worker_time_ms =
23867+
deqs.max_worker_time / 1000.,
23868+
max_elapsed_time_ms =
23869+
deqs.max_elapsed_time / 1000.
2385123870
INTO #dm_exec_query_stats
2385223871
FROM sys.dm_exec_query_stats AS deqs
2385323872
WHERE EXISTS
@@ -23879,8 +23898,10 @@ BEGIN
2387923898
ap.executions_per_second,
2388023899
ap.total_worker_time_ms,
2388123900
ap.avg_worker_time_ms,
23901+
ap.max_worker_time_ms,
2388223902
ap.total_elapsed_time_ms,
2388323903
ap.avg_elapsed_time_ms,
23904+
ap.max_elapsed_time_ms,
2388423905
ap.total_logical_reads_mb,
2388523906
ap.total_physical_reads_mb,
2388623907
ap.total_logical_writes_mb,
@@ -23923,7 +23944,9 @@ BEGIN
2392323944
c.min_used_threads,
2392423945
c.max_used_threads,
2392523946
c.total_rows,
23926-
c.query_plan
23947+
c.query_plan,
23948+
c.max_worker_time_ms,
23949+
c.max_elapsed_time_ms
2392723950
FROM #available_plans AS ap
2392823951
OUTER APPLY
2392923952
(
@@ -24074,6 +24097,8 @@ BEGIN
2407424097
@TargetSessionType,
2407524098
VictimsOnly =
2407624099
@VictimsOnly,
24100+
DeadlockType =
24101+
@DeadlockType,
2407724102
Debug =
2407824103
@Debug,
2407924104
Help =
@@ -24178,7 +24203,7 @@ BEGIN
2417824203
SET STATISTICS XML OFF;
2417924204
SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED;
2418024205

24181-
SELECT @Version = '8.20', @VersionDate = '20240522';
24206+
SELECT @Version = '8.21', @VersionDate = '20240701';
2418224207

2418324208
IF(@VersionCheckMode = 1)
2418424209
BEGIN

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ Navigation
2525
- [sp_BlitzAnalysis: Query sp_BlitzFirst output tables](#sp_blitzanalysis-query-sp_BlitzFirst-output-tables)
2626
- Backups and Restores:
2727
- [sp_BlitzBackups: How Much Data Could You Lose](#sp_blitzbackups-how-much-data-could-you-lose)
28-
- [sp_AllNightLog: Back Up Faster to Lose Less Data](#sp_allnightlog-back-up-faster-to-lose-less-data)
2928
- [sp_DatabaseRestore: Easier Multi-File Restores](#sp_databaserestore-easier-multi-file-restores)
3029
- [Parameters Common to Many of the Stored Procedures](#parameters-common-to-many-of-the-stored-procedures)
3130
- [License MIT](#license)
@@ -42,7 +41,7 @@ To install, [download the latest release ZIP](https://github.com/BrentOzarULTD/S
4241
The First Responder Kit runs on:
4342

4443
* SQL Server on Windows - all versions that Microsoft supports. For end of support dates, check out the "Support Ends" column at https://sqlserverupdates.com.
45-
* SQL Server on Linux - yes, fully supported except sp_AllNightLog and sp_DatabaseRestore, which require xp_cmdshell, which Microsoft doesn't provide on Linux.
44+
* SQL Server on Linux - yes, fully supported except sp_DatabaseRestore, which require xp_cmdshell, which Microsoft doesn't provide on Linux.
4645
* Amazon RDS SQL Server - fully supported.
4746
* Azure SQL DB - not supported. Some of the procedures work, but some don't, and Microsoft has a tendency to change DMVs in Azure without warning, so we don't put any effort into supporting it. If it works, great! If not, any changes to make it work would be on you. [See the contributing.md file](CONTRIBUTING.md) for how to do that.
4847

@@ -275,7 +274,6 @@ sp_BlitzIndex focuses on mainstream index types. Other index types have varying
275274

276275
* Fully supported: rowstore indexes, columnstore indexes, temporal tables.
277276
* Columnstore indexes: fully supported. Key columns are shown as includes rather than keys since they're not in a specific order.
278-
* In-Memory OLTP (Hekaton): unsupported. These objects show up in the results, but for more info, you'll want to use sp_BlitzInMemoryOLTP instead.
279277
* Graph tables: unsupported. These objects show up in the results, but we don't do anything special with 'em, like call out that they're graph tables.
280278
* Spatial indexes: unsupported. We call out that they're spatial, but we don't do any special handling for them.
281279
* XML indexes: unsupported. These objects show up in the results, but we don't include the index's columns or sizes.
@@ -465,7 +463,7 @@ Parameters include:
465463
* @Debug - default 0. When 1, we print out messages of what we're doing in the messages tab of SSMS.
466464
* @StopAt NVARCHAR(14) - pass in a date time to stop your restores at a time like '20170508201501'. This doesn't use the StopAt parameter for the restore command - it simply stops restoring logs that would have this date/time's contents in it. (For example, if you're taking backups every 15 minutes on the hour, and you pass in 9:05 AM as part of the restore time, the restores would stop at your last log backup that doesn't include 9:05AM's data - but it won't restore right up to 9:05 AM.)
467465
* @SkipBackupsAlreadyInMsdb - default 0. When set to 1, we check MSDB for the most recently restored backup from this log path, and skip all backup files prior to that. Useful if you're pulling backups from across a slow network and you don't want to wait to check the restore header of each backup.
468-
466+
* @EnableBroker - default 0. When set to 1, we run RESTORE WITH ENABLE_BROKER, enabling the service broker. Unless specified, the service broker is disabled on restore even if it was enabled when the backup was taken.
469467

470468
For information about how this works, see [Tara Kizer's white paper on Log Shipping 2.0 with Google Compute Engine.](https://www.brentozar.com/archive/2017/03/new-white-paper-build-sql-server-disaster-recovery-plan-google-compute-engine/)
471469

SqlServerVersions.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ VALUES
5757
(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'),
5858
(16, 1050, 'RTM GDR', 'https://support.microsoft.com/kb/5021522', '2023-02-14', '2028-01-11', '2033-01-11', 'SQL Server 2022 GDR', 'RTM'),
5959
(16, 1000, 'RTM', '', '2022-11-15', '2028-01-11', '2033-01-11', 'SQL Server 2022', 'RTM'),
60+
(15, 4375, 'CU27', 'https://support.microsoft.com/kb/5037331', '2024-06-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 27'),
6061
(15, 4365, 'CU26', 'https://support.microsoft.com/kb/5035123', '2024-04-11', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 26'),
6162
(15, 4355, 'CU25', 'https://support.microsoft.com/kb/5033688', '2024-02-15', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 25'),
6263
(15, 4345, 'CU24', 'https://support.microsoft.com/kb/5031908', '2023-12-14', '2025-01-07', '2030-01-08', 'SQL Server 2019', 'Cumulative Update 24'),

0 commit comments

Comments
 (0)