Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Latest commit

 

History

History
History
54 lines (53 loc) · 2.3 KB

File metadata and controls

54 lines (53 loc) · 2.3 KB
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
/*
https://sql-sasquatch.blogspot.com/2019/09/placeholder.html
*/
WITH tgt AS (SELECT instance_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Target Node Memory (KB)'
UNION ALL
SELECT 'TOTAL', cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Target Server Memory (KB)'),
tot AS (SELECT instance_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Total Node Memory (KB)'
UNION ALL
SELECT 'TOTAL', cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Total Server Memory (KB)'),
dbc AS (SELECT instance_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Database Node Memory (KB)'
UNION ALL
SELECT 'TOTAL', cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Database Cache Memory (KB)'),
stl AS (SELECT instance_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Stolen Node Memory (KB)'
UNION ALL
SELECT 'TOTAL', cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Stolen Server Memory (KB)'),
fre AS (SELECT instance_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Free Node Memory (KB)'
UNION ALL
SELECT 'TOTAL', cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Free Memory (KB)'),
frn AS (SELECT instance_name, cntr_value
FROM sys.dm_os_performance_counters
WHERE counter_name = 'Foreign Node Memory (KB)'
UNION ALL
SELECT 'TOTAL', cntr_value = CONVERT(INT, NULL))
SELECT tgt.instance_name, target_kb = tgt.cntr_value,
total_kb = tot.cntr_value, dbCache_kb = dbc.cntr_value,
stolen_kb = stl.cntr_value, free_kb = fre.cntr_value,
foreign_kb = frn.cntr_value
FROM tgt
INNER JOIN tot ON tgt.instance_name = tot.instance_name
INNER JOIN frn ON tgt.instance_name = frn.instance_name
INNER JOIN dbc ON tgt.instance_name = dbc.instance_name
INNER JOIN stl ON tgt.instance_name = stl.instance_name
INNER JOIN fre ON tgt.instance_name = fre.instance_name;
Morty Proxy This is a proxified and sanitized view of the page, visit original site.