Skip to content

Commit 02fab8f

Browse files
Update sp_HealthParser.sql
1 parent f31bad8 commit 02fab8f

1 file changed

Lines changed: 33 additions & 9 deletions

File tree

sp_HealthParser/sp_HealthParser.sql

Lines changed: 33 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,12 +1063,12 @@ AND ca.utc_timestamp < @end_date';
10631063
id bigint IDENTITY,
10641064
collection_time datetime2(7) NOT NULL DEFAULT SYSDATETIME(),
10651065
event_time datetime2(7) NULL,
1066-
error_number int NULL,
1067-
severity int NULL,
1068-
state int NULL,
1066+
error_number integer NULL,
1067+
severity integer NULL,
1068+
state integer NULL,
10691069
message nvarchar(max) NULL,
10701070
database_name sysname NULL,
1071-
database_id int NULL,
1071+
database_id integer NULL,
10721072
PRIMARY KEY CLUSTERED (collection_time, id)
10731073
);
10741074
IF @debug = 1 BEGIN RAISERROR(''Created table %s for severe errors logging.'', 0, 1, ''' + @log_table_severe_errors + N''') WITH NOWAIT; END;
@@ -1660,6 +1660,30 @@ AND ca.utc_timestamp < @end_date';
16601660
OPTION(RECOMPILE);
16611661
END;
16621662

1663+
/* Add memory node OOM collection for MI */
1664+
IF @what_to_check IN ('all', 'memory')
1665+
BEGIN
1666+
IF @debug = 1
1667+
BEGIN
1668+
RAISERROR('Checking Managed Instance memory node OOM events', 0, 0) WITH NOWAIT;
1669+
RAISERROR('Inserting #memory_node_oom', 0, 0) WITH NOWAIT;
1670+
END;
1671+
1672+
INSERT
1673+
#memory_node_oom
1674+
WITH
1675+
(TABLOCKX)
1676+
(
1677+
memory_node_oom
1678+
)
1679+
SELECT
1680+
e.x.query('.')
1681+
FROM #ring_buffer AS rb
1682+
CROSS APPLY rb.ring_buffer.nodes('/event') AS e(x)
1683+
WHERE e.x.exist('@name[.= "memory_node_oom_ring_buffer_recorded"]') = 1
1684+
OPTION(RECOMPILE);
1685+
END;
1686+
16631687
END; /*End Managed Instance collection*/
16641688

16651689
IF @debug = 1
@@ -3285,7 +3309,7 @@ END;
32853309
CONVERT
32863310
(
32873311
money,
3288-
mbi.currently_predicated / 1024.0
3312+
mbi.currently_predicated / 1024.0 / 1024.0
32893313
),
32903314
1
32913315
),
@@ -3301,7 +3325,7 @@ END;
33013325
CONVERT
33023326
(
33033327
money,
3304-
mbi.currently_allocated / 1024.0
3328+
mbi.currently_allocated / 1024.0 / 1024.0
33053329
),
33063330
1
33073331
),
@@ -3317,7 +3341,7 @@ END;
33173341
CONVERT
33183342
(
33193343
money,
3320-
mbi.previously_allocated / 1024.0
3344+
mbi.previously_allocated / 1024.0 / 1024.0
33213345
),
33223346
1
33233347
),
@@ -4596,7 +4620,7 @@ END;
45964620
isolation_level = bd.value('(process/@isolationlevel)[1]', 'nvarchar(50)'),
45974621
log_used = bd.value('(process/@logused)[1]', 'bigint'),
45984622
clientoption1 = bd.value('(process/@clientoption1)[1]', 'bigint'),
4599-
clientoption2 = bd.value('(process/@clientoption1)[1]', 'bigint'),
4623+
clientoption2 = bd.value('(process/@clientoption2)[1]', 'bigint'),
46004624
activity = CASE WHEN bd.exist('//blocked-process-report/blocked-process') = 1 THEN 'blocked' END,
46014625
blocked_process_report = bd.query('.')
46024626
INTO #blocked
@@ -4657,7 +4681,7 @@ END;
46574681
isolation_level = bg.value('(process/@isolationlevel)[1]', 'nvarchar(50)'),
46584682
log_used = bg.value('(process/@logused)[1]', 'bigint'),
46594683
clientoption1 = bg.value('(process/@clientoption1)[1]', 'bigint'),
4660-
clientoption2 = bg.value('(process/@clientoption1)[1]', 'bigint'),
4684+
clientoption2 = bg.value('(process/@clientoption2)[1]', 'bigint'),
46614685
activity = CASE WHEN bg.exist('//blocked-process-report/blocking-process') = 1 THEN 'blocking' END,
46624686
blocked_process_report = bg.query('.')
46634687
INTO #blocking

0 commit comments

Comments
 (0)