Stairway to SQL Server Extended Events Level 1: From SQL Trace to Extended Events

  • Comments posted to this topic are about the item Stairway to SQL Server Extended Events Level 1: From SQL Trace to Extended Events

  • What a great article. Thank you.

  • Thanks Erin! I was waiting for a Stairway on this to direct my colleagues to. It seems, though, that the script portion of the article for creating an event session compared with creating a trace does not include the CREATE portion for the XE, only the IF EXISTS... DROP...

    Jared
    CE - Microsoft

  • Jared, you're correct! Listing 9 should have the following code:

    /* Extended Events */

    CREATE EVENT SESSION [XE_ReadsFilter_Trace]

    ON SERVER

    I have notified SSC and we'll get it updated, thanks for letting me know!

    Erin

  • Great article. Thanks.

  • Unfortunately this sp(sp_SQLskills_ConvertTraceToExtendedEvents) does not work on SQL Server 2008, because sys.trace_xe_event_map system table was introduced later in v11. 🙂

  • Correct, the script does only work for SQL Server 2012 and higher, and this is noted in the post. If you're using SQL Server 2008R2 and below, stick with Trace.

  • This is great! I've been procrastinating on switching from SQL Trace to Extended Events. Now I have no excuse! (well, maybe until this stairway series is finished :Whistling: )

  • Hi Erin, 

         
          -- EndTime implemented by another Action in XE already      
           -- StartTime implemented by another Action in XE already 
     
    Could you please elaborate on these two, I would like to have these columns along with all other info I'm getting with rpc_completed extended event session. 
    If these are from another action in XE, could you tell action name like sqlos, sqlserver .. etc.. ) 

    -- NICE SERIES on XE..

  • SQLSCCOM - Thursday, April 13, 2017 10:01 PM

    Hi Erin, 

         
          -- EndTime implemented by another Action in XE already      
           -- StartTime implemented by another Action in XE already 
     
    Could you please elaborate on these two, I would like to have these columns along with all other info I'm getting with rpc_completed extended event session. 
    If these are from another action in XE, could you tell action name like sqlos, sqlserver .. etc.. ) 

    -- NICE SERIES on XE..

    Hi-

    StartTime and EndTime aren't implemented as separate elements in Extended Events.  The rpc_completed event has a timestamp column, which is the end of the event.  You can use duration to calculate the start time.  There are issues to be aware of related to the timestamp, see Jon's post: https://www.sqlskills.com/blogs/jonathan/incorrect-timestamp-on-events-in-extended-events/

    Erin

  • Erin, very interesting post. However, I followed instructions and XE session created but when I read the details of the output of the session, it mentions events without indicating the object that is concerned by the event, here is a line form my session where we see "missing column statstics " butit does not say which column

     

    name timestamp timestamp (UTC) database_id object_id object_type index_id related_object_id ddl_phase transaction_id object_name database_name transaction_sequence session_server_principal_name

    session_resource_group_id session_id server_principal_sid server_principal_name server_instance_name request_id nt_username is_system event_sequence client_pid client_hostname

    client_app_name column_list sort_warning_type query_operation_node_id thread_id dop granted_memory_kb used_memory_kb worktable_physical_reads worktable_physical_writes actual_row_count

    missing_column_statistics

    2021-12-22 20:07:33.2035286

    2021-12-22 19:07:33.2035286

    4

    NULL

    NULL

    NULL

    NULL

    NULL

    13368922

    NULL

    msdb

    0 mydomain\myuser

    2

    378

    0x010500000000000515000000B0AD624CEA76D9B0107863E451040000

    mydomain\myuser

    SQL2K12

    0

    mydomain\myuser

    False

    257

    4932

    SQL2K12

    SQLAgent - TSQL JobStep (Job 0x137D5FDEB6F5704FB9343D544E25600D : Step 1)

    NULL NULL NULL NULL NULL NULL NULL NULL NULL

     

Viewing 11 posts - 1 through 10 (of 10 total)

You must be logged in to reply to this topic. Login to reply