2

Following is the setup in wizard - where global fields to capture are listed, enter image description here

But why not appearing for selection in Watch Live Data? Is there anything to be done in addition? enter image description here

Adding script of the same,

CREATE EVENT SESSION [Test_EE] ON SERVER 
ADD EVENT sqlserver.attention(
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)) AND [sqlserver].[database_name]=N'DBName')),
ADD EVENT sqlserver.existing_connection(SET collect_database_name=(1),collect_options_text=(1)
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname)
    WHERE ([sqlserver].[database_name]=N'DBName' AND [started_event_session_name]='Test_EE')),
ADD EVENT sqlserver.lock_deadlock(SET collect_database_name=(1)
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([sqlserver].[database_name]=N'DBName')),
ADD EVENT sqlserver.login(SET collect_database_name=(1),collect_options_text=(1)
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([sqlserver].[database_name]=N'DBName')),
ADD EVENT sqlserver.logout(
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([sqlserver].[database_name]=N'DBName')),
ADD EVENT sqlserver.rpc_completed(
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)) AND [sqlserver].[database_name]=N'DBName')),
ADD EVENT sqlserver.sp_statement_completed(SET collect_object_name=(1)
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([sqlserver].[database_name]=N'DBName')),
ADD EVENT sqlserver.sql_batch_completed(
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)) AND [sqlserver].[database_name]=N'DBName')),
ADD EVENT sqlserver.sql_batch_starting(
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_id,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([package0].[equal_boolean]([sqlserver].[is_system],(0)) AND [sqlserver].[database_name]=N'DBName')),
ADD EVENT sqlserver.sql_statement_completed(SET collect_statement=(1)
    ACTION(package0.event_sequence,package0.process_id,sqlos.cpu_id,SQLSatellite.AppName,sqlserver.client_app_name,sqlserver.client_connection_id,sqlserver.client_hostname,sqlserver.client_pid,sqlserver.database_name,sqlserver.nt_username,sqlserver.query_hash,sqlserver.server_instance_name,sqlserver.server_principal_name,sqlserver.session_id,sqlserver.session_nt_username,sqlserver.sql_text,sqlserver.transaction_id,sqlserver.transaction_sequence,sqlserver.username)
    WHERE ([sqlserver].[database_name]=N'DBName'))
ADD TARGET package0.event_file(SET filename=N'E:\TEE.xel')
WITH (MAX_MEMORY=8192 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS,MAX_DISPATCH_LATENCY=5 SECONDS,MAX_EVENT_SIZE=0 KB,MEMORY_PARTITION_MODE=PER_CPU,TRACK_CAUSALITY=ON,STARTUP_STATE=ON)
GO

Two different initiation of retrieval of events i.e before the events are retrieved - 1. Manually created session displaying all selected fields 2. Test_EE1 - created from wizard not showing all the selected fields. Why different functioning?

enter image description here

6
  • It seems you don't have any events yet. Does it change if the trace has received events? Commented Aug 28 at 5:44
  • No Retrieving event information from server stands still. Never gets any events. But, another session similar to it which I created without wizard retrieves events.
    – Meera K
    Commented Aug 28 at 11:43
  • If you don't have any events,then the gui don't know what columns there are. So this is expected behavior. Commented Aug 28 at 16:32
  • May be. But I've updated the question with the difference in the columns retrieved - which says GUI does brings all columns only for the EE created manually and not for the ones wizard created.
    – Meera K
    Commented Aug 29 at 5:35
  • I created a trace using your CREATE command and the GUI did only show the default columns (name and timestamp) when there are 0 events. That goes for both looking at the file as well as watch live data. So, creating it "manually" as you call it vs the wizard is evidently not the reason for the difference. Commented Aug 30 at 11:05

1 Answer 1

1

XE available columns will be loading with a first event.

enter image description here

It is confusing but if there are no event then no available columns seen except initials. enter image description here

After XE loads events then you can manage colums to display.

enter image description here

After selecting needed columns to the right we able to save the view for the next time by escaping with OK button.

After saving the view if we open XE, it loads view as an initial, as shown in the following picture.

XE initial columns.

enter image description here

XE loaded events

enter image description here

5
  • 1
    Excellent info. I never even checked something like this. Commented Aug 28 at 11:36
  • ok.. I'll try again.
    – Meera K
    Commented Aug 28 at 11:47
  • I've different result - posting the screenshot of all columns displayed even before the events are retrieved.
    – Meera K
    Commented Aug 28 at 12:07
  • 1
    After selecting needed columns and saving with ok as a view the next time XE starts with the column view. I modified the answer with 2 screenshot. Commented Aug 28 at 13:22
  • Good to know. But to me the wizard created EE never retrieves anything. It seems it doesn't start only, as it always keeps displaying 'Retrieving event information from server ...' . Even if kept opened for hours. Wizard wise no good experience.
    – Meera K
    Commented Sep 2 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.