November 3, 2023 at 2:27 am
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
November 3, 2023 at 2:32 am
To clarify, I have sysadmin rights on the server (my home computer). I tried the following steps.
November 3, 2023 at 3:08 am
Did you start the session?
ALTER EVENT SESSION [testsession] ON SERVER
STATE=START;
Eddie Wuerch
MCM: SQL
November 3, 2023 at 3:37 am
Yes
November 3, 2023 at 8:21 am
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.
November 3, 2023 at 12:50 pm
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
November 3, 2023 at 2:01 pm
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.
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
November 3, 2023 at 5:58 pm
thanks all. Seems to be working now.
November 4, 2023 at 9:47 pm
thanks all. Seems to be working now.
What did you change to make it so?
--Jeff Moden
Change is inevitable... Change for the better is not.
November 5, 2023 at 2:50 am
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