Skip to content

Commit ffc4769

Browse files
authored
Merge pull request #3596 from BrentOzarULTD/3586_sp_Blitz_memory_counters
#3586 - adding target & total memory counters to server info section. Closes #3586.
2 parents 91db9a5 + 57f34db commit ffc4769

File tree

2 files changed

+33
-2
lines changed

2 files changed

+33
-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: 265.
10-
If you want to add a new one, start at 266.
9+
CURRENT HIGH CHECKID: 266.
10+
If you want to add a new one, start at 267.
1111

1212
| Priority | FindingsGroup | Finding | URL | CheckID |
1313
|----------|-----------------------------|---------------------------------------------------------|------------------------------------------------------------------------|----------|
@@ -301,6 +301,7 @@ If you want to add a new one, start at 266.
301301
| 250 | Server Info | Drive Space | | 92 |
302302
| 250 | Server Info | Full-text Filter Daemon is Currently Offline | | 168 |
303303
| 250 | Server Info | Hardware | | 84 |
304+
| 250 | Server Info | Hardware - Memory Counters | https://www.BrentOzar.com/go/target | 266 |
304305
| 250 | Server Info | Hardware - NUMA Config | | 114 |
305306
| 250 | Server Info | Instant File Initialization Enabled | https://www.BrentOzar.com/go/instant | 193 |
306307
| 250 | Server Info | Locked Pages in Memory Enabled | https://www.BrentOzar.com/go/lpim | 166 |

sp_Blitz.sql

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9970,6 +9970,36 @@ IF @ProductVersionMajor >= 10 AND NOT EXISTS ( SELECT 1
99709970
END;
99719971
END; /* CheckID 261 */
99729972

9973+
9974+
IF NOT EXISTS ( SELECT 1
9975+
FROM #SkipChecks
9976+
WHERE DatabaseName IS NULL AND CheckID = 266 )
9977+
BEGIN
9978+
INSERT INTO #BlitzResults
9979+
( CheckID ,
9980+
Priority ,
9981+
FindingsGroup ,
9982+
Finding ,
9983+
URL ,
9984+
Details
9985+
)
9986+
SELECT 266 AS CheckID ,
9987+
250 AS Priority ,
9988+
'Server Info' AS FindingsGroup ,
9989+
'Hardware - Memory Counters' AS Finding ,
9990+
'https://www.brentozar.com/go/target' AS URL ,
9991+
N'Target Server Memory (GB): ' + CAST((CAST((pTarget.cntr_value / 1024.0 / 1024.0) AS DECIMAL(10,1))) AS NVARCHAR(100))
9992+
+ N' Total Server Memory (GB): ' + CAST((CAST((pTotal.cntr_value / 1024.0 / 1024.0) AS DECIMAL(10,1))) AS NVARCHAR(100))
9993+
FROM sys.dm_os_performance_counters pTarget
9994+
INNER JOIN sys.dm_os_performance_counters pTotal
9995+
ON pTotal.object_name LIKE 'SQLServer:Memory Manager%'
9996+
AND pTotal.counter_name LIKE 'Total Server Memory (KB)%'
9997+
WHERE pTarget.object_name LIKE 'SQLServer:Memory Manager%'
9998+
AND pTarget.counter_name LIKE 'Target Server Memory (KB)%'
9999+
END
10000+
10001+
10002+
997310003
END; /* IF @CheckServerInfo = 1 */
997410004
END; /* IF ( ( SERVERPROPERTY('ServerName') NOT IN ( SELECT ServerName */
997510005

0 commit comments

Comments
 (0)