Date post: | 27-Jul-2015 |
Category: |
Documents |
Upload: | antonios-chatzipavlis |
View: | 145 times |
Download: | 2 times |
CHAPTER
Using Extended Events
for Troubleshooting
SQL ServerAntonios ChatzipavlisSQLschool.gr Founder, Principal Consultant
SQL Server Evangelist, MVP on SQL Server
June 4, 2015
I have been started with computers.
I started my professional carrier in computers industry.
I have been started to work with SQL Server version 6.0
I earned my first certification at Microsoft as Microsoft Certified Solution
Developer (3rd in Greece) and started my carrier as Microsoft Certified
Trainer (MCT) with more than 20.000 hours of training until now!
I became for first time Microsoft MVP on SQL Server
I created the SQL School Greece (www.sqlschool.gr)
I became MCT Regional Lead by Microsoft Learning Program.
I was certified as MCSE : Data Platform, MCSE: Business Intelligence
Antonios ChatzipavlisDatabase Archi tect
SQL Server Evange l i st
MCT, MCSE, MCITP, MCPD, MCSD, MCDBA,
MCSA, MCTS, MCAD, MCP, OCA, ITIL-F
1982
1988
1996
1998
2010
2012
2013
CHAPTER
Follow us in social media
Twitter @antoniosch / @sqlschool
Facebook fb/sqlschoolgr
YouTube yt/user/achatzipavlis
LinkedIn SQL School Greece group
Pinterest pi/SQLschool/
Extended Events was introduced in
SQL Server 2008 as a new method of
collecting diagnostic data from SQL Server
• It’s the FUTURE• SQL Trace is a deprecated feature in SQL Server 2012
• This makes understanding XE crucial to supporting SQL Server in the future
• Less overhead• Lightweight to minimize impact
• Provides minimum schema of data that is specific to the event being fired
• Events are filtered early in the firing lifecycle based on the predicates
• Flexibility and Power• Allows complex configurations for event collection that simplify problem
identification.
• Many events in more recent releases
Why Extended Events?
• Events Mapping Query
• Column to Action Mapping Query
Switch from SQL Trace to XEvents
select xe.xe_event_name,st.namefrom sys.trace_xe_event_map as xeinner join sys.trace_events as ston xe.trace_event_id = st.trace_event_id;
select xe.xe_action_name, tc.namefrom sys.trace_xe_action_map as xeinner join sys.trace_columns as tcon xe.trace_column_id = tc.trace_column_id;
• Sessions• Are a functional boundary for configuration of events
• Events• Correspond to well-know points of code
• Predicates• Boolean expressions that define the conditions required for an event to actually
fire
• Actions• Actions only execute after predicate evaluation determines the event will fire
• Targets• Targets are event consumers
Extended Events Architecture
Event Life Cycle
Event point
encountered in code
Is Event
Enabled in a
sessionCode Continues
Buffer Data for
Asynchronus Targets
Send to Synchronous
Targets Immediately
Execute Actions and
Collect data
(if applicable)
Are there
configurable
columns
Collect
non-configurable
column data
Passes Filter
Criteria
(Predicate)
Collect Configurable
Column data
No
No
Yes
Yes
Yes
• Event counter• Counts all specified events that occur during an Extended Events session.
• Use to obtain information about workload characteristics without adding the
overhead of full event collection.
• This is a synchronous target.
• Event file• Use to write event session output from complete memory buffers to disk.
• This is an asynchronous target.
Targets - 1
• Event pairing• Many kinds of events occur in pairs, such as lock acquires and lock releases.
• Use to determine when a specified paired event does not occur in a
matched set.
• This is an asynchronous target.
• Event Tracing for Windows (ETW)• Use to correlate SQL Server events with Windows operating system or
application event data.
• This is a synchronous target.
Targets - 2
• Histogram• Use to count the number of times that a specified event occurs, based on a
specified event column or action.
• This is an asynchronous target.
• Ring buffer• Use to hold the event data in memory on a first-in first-out (FIFO) basis, or
on a per-event FIFO basis.
• This is an asynchronous target.
Targets - 3
DEMO
CHAPTER
Use case scenarios of Extended Events
SQL Server 2016
• Live Query Stats (LQS)
• Query Store
SQL Server 2016
Thank you
SELECT
KNOWLEDGE
FROM
SQL SERVER
http://www.sqlschool.gr
Copyright © 2015 SQL School Greece