为什么 Azure SQL sys.event_log table 中没有 "additional_data"?
Why there is no "additional_data" in Azure SQL sys.event_log table?
我有 Azure SQL 数据库
服务器版本V12
基本定价层(5 个 DTU)
经过几次死锁后,table sys.event_log 中的 additional_data 列中没有任何信息。
运行 "master" 数据库上的以下脚本:
SELECT * FROM sys.event_log WHERE event_type = 'deadlock'
从Official documentation,我可以看到:
The following query returns all deadlock events for database Database1 (applies only to Azure SQL Database V11).
SELECT * FROM sys.event_log
WHERE event_type = 'deadlock'
AND database_name = 'Database1';
The following query returns all deadlock events for database Database1 (applies only to Azure SQL Database V12).
WITH CTE AS (
SELECT CAST(event_data AS XML) AS [target_data_XML]
FROM sys.fn_xe_telemetry_blob_target_read_file('dl', null, null, null)
)
SELECT target_data_XML.value('(/event/@timestamp)[1]', 'DateTime2') AS Timestamp,
target_data_XML.query('/event/data[@name=''xml_report'']/value/deadlock') AS deadlock_xml,
target_data_XML.query('/event/data[@name=''database_name'']/value').value('(/value)[1]', 'nvarchar(100)') AS db_name
FROM CTE
我有 Azure SQL 数据库
服务器版本V12 基本定价层(5 个 DTU)
经过几次死锁后,table sys.event_log 中的 additional_data 列中没有任何信息。
运行 "master" 数据库上的以下脚本:
SELECT * FROM sys.event_log WHERE event_type = 'deadlock'
从Official documentation,我可以看到:
The following query returns all deadlock events for database Database1 (applies only to Azure SQL Database V11).
SELECT * FROM sys.event_log
WHERE event_type = 'deadlock'
AND database_name = 'Database1';
The following query returns all deadlock events for database Database1 (applies only to Azure SQL Database V12).
WITH CTE AS (
SELECT CAST(event_data AS XML) AS [target_data_XML]
FROM sys.fn_xe_telemetry_blob_target_read_file('dl', null, null, null)
)
SELECT target_data_XML.value('(/event/@timestamp)[1]', 'DateTime2') AS Timestamp,
target_data_XML.query('/event/data[@name=''xml_report'']/value/deadlock') AS deadlock_xml,
target_data_XML.query('/event/data[@name=''database_name'']/value').value('(/value)[1]', 'nvarchar(100)') AS db_name
FROM CTE