1. Japan SQL Server User Group
Kenichiro Nakamura
Oct/20 2018
Extended Events 101
2. SQL Server Extended Events
Extended Events
Extended Events is a light weight
performance monitoring system that uses
very few performance resources.
It builds on existing concepts, such as an
event or an event consumer, uses concepts
from Event Tracing for Windows, and
introduces new concepts.
3. • Capture queries
• Capture system eventCollect
• Save results to persist target
• Save results to temporary targetStore
• Grouping, ordering, aggregating resultAnalyze
• Configurations
• ExecutionsManage
• GUI tools
• T-SQL supportTools
What’s Extended Events
SQL Server Extended Events Packages
4. XEvent vs SQL Profiler
Extended Events
XEvent since SQL Server 2008
No UI in 2008
UI in 2012 and keep adding features
SQL Profiler since SQL Server 7.0
Deprecated in SQL Server 2012
No more features
SQL Server Profiler
5. XEvent vs SQL Profiler
Extended Events
XEvent
SELECT * FROM sys.dm_xe_objects
where object_type = 'event'
SQL Profiler
SELECT * FROM sys.trace_events
SQL Server Profiler
12. • monitoring points of interest in the execution path of a program
• can be used solely for tracing purposes or for triggering actionsEvent
• consumers that receive dataTargets
• programmatic response or series of responses to an event
• invoked synchronously on the thread that fired the eventActions
• Describe package object types such as event, action, etcTypes
• set of logical rules that are used to evaluate events
• selectively capture event data based on specific criteriaPredicates
• maps an internal value to a string, which enables a user to know what
the value representsMaps
Extended Events Packages
SQL Server Extended Events Packages
19. Action
Events
Additional Data (Global Fields)
• Capture a stack dump and inspect data.
• Store state information in a local context using variable storage.
• Aggregate event data.
• Append data to event data.
• Some typical and well known examples of actions are:
• Stack dumper
• Execution plan detection ( SQL Server only)
• Transact-SQL stack collection ( SQL Server only)
• Run time statistics calculation
• Gather user input on exception
23. Create an Extended Events Session Using the New Session Dialog
Create Extended Events Session
New Session Wizard
Easy to create session
Expose “most” settings
New Session
Granular control
Expose “all” settings
Create an Extended Events Session Using the Wizard