Extended Events Flashcards

1
Q

How do you create an Extended Event?

A

create event session log_growth on server
ADD EVENT sqlserver.databases_log_growth
( action (sqlserver.database_id))
add target package0.asynchronous_file_target
(SET filename=N’C:\xevent\log_growth.xel’, metadatafile=N’C:\xevent\log_growth.xem’);

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

TSQL to start Extended Event session?

A

alter event session log_growth on server state = start;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

TSQL to stop Extended Event session?

A

alter event session log_growth on server state = stop;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

TSQL to read Extended Event file?

A

select *
from sys.fn_xe_file_target_read_file
(N’C:\xevent\log_growth*.xel’, N’C:\xevent\log_growth*.xem’, null, null)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

TSQL to view all created Extended Events sessions?

A

SELECT *
FROM sys.server_event_sessions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

TSQL to view all running Extended Events sessions?

A

SELECT *
FROM sys.dm_xe_sessions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

TSQL to drop Extended Event session?

A

drop event session <session_name> on server

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

TSQL to view registered packages?

A

SELECT *
FROM sys.dm_xe_packages

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

TSQL to view available Extended Events objects?

A

SELECT *
FROM sys.dm_xe_objects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

TSQL to view schema information for all the Extended Events objects?

A

SELECT *
FROM sys.dm_xe_object_columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

TSQL to view map values?

A

SELECT *
FROM sys.dm_xe_map_values

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

TSQL to view information about session targets?

A

SELECT *
FROM sys.dm_xe_session_targets

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

TSQL to view information about session events?

A

SELECT *
FROM sys.dm_xe_session_events

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

TSQL to view information about event session actions?

A

SELECT *
FROM sys.dm_xe_session_event_actions

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

TSQL to view configuration values for objects that are bound to a session?

A

SELECT *
FROM sys.dm_xe_session_object_columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

TSQL to view each event in a event session?

A

SELECT *
FROM sys.server_event_session_events

17
Q

TSQL to view each action in a event session?

A

SELECT *
FROM sys.server_event_session_actions

18
Q

TSQL to view each event target in a event session?

A

SELECT *
FROM sys.server_event_session_targets

19
Q

TSQL to view each customizable column that was explicitly set on events and targets?

A

SELECT *
FROM sys.server_event_session_fields

20
Q
A