extended events not showing events

  • hi,

    I'm using SQL SERVER 2022. I've created a simple extended event just for experimental purposes, but it doesn't appear to capture any events. Could you pls review the script below and let me know if you see anything wrong? Thanks!

    CREATE EVENT SESSION [testsession] ON SERVER 
    ADD EVENT sqlserver.database_created
    ADD TARGET package0.event_file(SET filename=N'C:\test\test.xel')
    WITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=OFF,STARTUP_STATE=OFF)
    GO
  • To clarify, I have sysadmin rights on the server (my home computer). I tried the following steps.

    1. create a test database
    2. right click package0.event_file, select view target data
    3. no events appear in the session tab
  • Did you start the session?

    ALTER EVENT SESSION [testsession] ON SERVER
    STATE=START;

    Eddie Wuerch
    MCM: SQL

  • Yes

  • View the live data before creating the database.

    You only view data after the live data view has been opened, so if you create the database before viewing live data you don't get any output in the view

    However if you open  the XEL file you will see the data prior to opening the live view.

  • Yeah, it's as @Ant-Green has it. You have to have the live data window open first. It only shows active events. However, you can directly open the file, and it will open in another window that is the Live Data window, but for the file. That gives you sorting, grouping, searching, and all the rest of the functionality of the live data window, but on the file.

    "The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
    - Theodore Roosevelt

    Author of:
    SQL Server Execution Plans
    SQL Server Query Performance Tuning

  • With the exception of adding a step #0 to start the session, I repeated your posted steps on SQL2022 in the same order, Viewing Target Data after the CREATE DATABASE call completed; the event is displayed.

    Screenshot 2023-11-03 100042

    I'm blanking on what to try next (maybe try opening the .xel file directly from the file system?), but your steps as I performed them look correct.

     

    Eddie Wuerch
    MCM: SQL

  • thanks all. Seems to be working now.

  • robh0502 wrote:

    thanks all. Seems to be working now.

    What did you change to make it so?

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • Well, not sure. I think I just deleted all of the .xel files in the folder and retried. Seemed to work finely after that.

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

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