Skip to content

Commit 5f21ae2

Browse files
authored
Merge pull request #3743 from BrentOzarULTD/3741_sp_Blitz_optimized_locking
#3741 sp_Blitz optimized locking
2 parents 6300d8a + 9284338 commit 5f21ae2

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

Documentation/sp_Blitz_Checks_by_Priority.md

Lines changed: 3 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: 271.
10-
If you want to add a new one, start at 272.
9+
CURRENT HIGH CHECKID: 272.
10+
If you want to add a new one, start at 273.
1111

1212
| Priority | FindingsGroup | Finding | URL | CheckID |
1313
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
@@ -87,6 +87,7 @@ If you want to add a new one, start at 272.
8787
| 100 | Performance | Many Plans for One Query | https://www.BrentOzar.com/go/parameterization | 160 |
8888
| 100 | Performance | Max Memory Set Too High | https://www.BrentOzar.com/go/max | 50 |
8989
| 100 | Performance | Memory Pressure Affecting Queries | https://www.BrentOzar.com/go/grants | 117 |
90+
| 100 | Performance | Optimized Locking Not Fully Set Up | https://www.BrentOzar.com/go/optimizedlocking | 272 |
9091
| 100 | Performance | Partitioned database with non-aligned indexes | https://www.BrentOzar.com/go/aligned | 72 |
9192
| 100 | Performance | Repetitive Maintenance Tasks | https://ola.hallengren.com | 181 |
9293
| 100 | Performance | Resource Governor Enabled | https://www.BrentOzar.com/go/rg | 10 |

sp_Blitz.sql

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4935,6 +4935,35 @@ AS
49354935
CLOSE DatabaseDefaultsLoop;
49364936
DEALLOCATE DatabaseDefaultsLoop;
49374937

4938+
/* CheckID 272 - Performance - Optimized Locking Not Fully Set Up */
4939+
IF EXISTS (SELECT * FROM sys.all_columns WHERE name = 'is_optimized_locking_on' AND object_id = OBJECT_ID('sys.databases'))
4940+
AND NOT EXISTS ( SELECT 1
4941+
FROM #SkipChecks
4942+
WHERE DatabaseName IS NULL AND CheckID = 272 )
4943+
BEGIN
4944+
IF @Debug IN (1, 2) RAISERROR('Running CheckId [%d].', 0, 1, 272) WITH NOWAIT;
4945+
4946+
INSERT INTO [#BlitzResults]
4947+
( [CheckID] ,
4948+
[Priority] ,
4949+
[FindingsGroup] ,
4950+
[Finding] ,
4951+
[DatabaseName] ,
4952+
[URL] ,
4953+
[Details] )
4954+
4955+
SELECT
4956+
272 AS [CheckID] ,
4957+
100 AS [Priority] ,
4958+
'Performance' AS [FindingsGroup] ,
4959+
'Optimized Locking Not Fully Set Up' AS [Finding] ,
4960+
name,
4961+
'https://www.brentozar.com/go/optimizedlocking' AS [URL] ,
4962+
'RCSI should be enabled on this database to get the full benefits of optimized locking.' AS [Details]
4963+
FROM sys.databases
4964+
WHERE is_optimized_locking_on = 1 AND is_read_committed_snapshot_on = 0;
4965+
END;
4966+
49384967
/* Check if target recovery interval <> 60 */
49394968
IF
49404969
@ProductVersionMajor >= 10

0 commit comments

Comments
 (0)