1> ALTER EVENT SESSION [xevent_name] 2> ON SERVER 3> STATE = START 4> GO -- 作成した拡張イベントセッションの状態を確認 ※拡張イベントセッションが開始の場合のみ結果が返る 1> SELECT * FROM sys.dm_xe_sessions 2> WHERE name = [xevent_name] 3> GO
23 -- 専用 SQL の実行 1> USE MASTER 2> GO 1> DECLARE @trace_id int 2> SET @trace_id = 2 -- ここでは対象 SQL Trace のトレースIDが 2 と想定 3> SELECT DISTINCT el.eventid, em.package_name, em.xe_event_name AS ‘event’ 4> , el.columned, ec.xe_action_name AS ‘action’ 5> FROM (sys.fn_trace_geteventinfo(@trace_id) AS el 6> LEFT OUTER JOIN sys.trace_xe_event_map AS em 7> ON el.eventid = em.trace_event_id) 8> LEFT OUTER JOIN sys.trace_xe_action_map AS ec 9> ON el.columnid = ec.trace_column_id 10> WHERE em.xe_event_name IS NOT NULL AND ec.xe_action_name IS NOT NULL 11> GO
Profiler の使用 • Use XEvent Profiler to capture queries in SQL Server 【Azure SQL Database】 • Professional Azure SQL Database Administration: Equip yourself with the skills to manage and maintain data in the cloud, 2nd Edition (English Edition) • Connect SQL Server Profiler 2017 to Azure SQL Server