Deadlock Chart from XE Ring Buffer
9. 10. 2019
Simple script to obtain deadlock graph from default XE session system_health. Contains only deadlocks capture for certain period of time back (hours). SELECT [xe].[query](‘(event/data/value/deadlock)[1]’) [DeadlockGraph] FROM ( SELECT [xe].[query](‘.’) [xe] FROM ( SELECT CAST([target_data] AS XML) [td] FROM [sys].[dm_xe_session_targets] [st] INNER JOIN [sys].[dm_xe_sessions] [s] ON [s].[address] = [st].[event_session_address] WHERE [s].[NAME]…