SQL Server扩展事件(Extended Events)-- 使用扩展事件跟踪监控死锁脚本实现
-- To get a list of the captured deadlocks and their graphs you can execute this query:select xml_data.value('(event[@name="xml_deadlock_report"]/@timestamp)','datetime') Execution_Time,
xml_data.value('(event/data/value)','varchar(max)') Query
from (select object_name as event, CONVERT(xml, event_data) as xml_data
from sys.fn_xe_file_target_read_file
('c:\temp\deadlock*.xel', 'c:\temp\deadlock*.xem', null, null)) v order by Execution_Time
页:
[1]