SlideShare a Scribd company logo
CHAPTER
Using Extended Events
for Troubleshooting
SQL Server
Antonios Chatzipavlis
SQLschool.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 Chatzipavlis
Database Architect
SQL Server Evangelist
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/
help@sqlschool.gr
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.name
from sys.trace_xe_event_map as xe
inner join sys.trace_events as st
on xe.trace_event_id = st.trace_event_id;
select xe.xe_action_name, tc.name
from sys.trace_xe_action_map as xe
inner join sys.trace_columns as tc
on 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
session
Code 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
Using extended events for troubleshooting sql server
Thank you
SELECT
KNOWLEDGE
FROM
SQL SERVER
http://www.sqlschool.gr
Copyright © 2015 SQL School Greece

More Related Content

What's hot (20)

PDF
Introduction to sql database on azure
Antonios Chatzipavlis
 
PDF
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services
Antonios Chatzipavlis
 
PPTX
Scalable relational database with SQL Azure
Shy Engelberg
 
PDF
SQL Server 2016 BI updates
Chris Testa-O'Neill
 
PPTX
Oracle Query Optimizer - An Introduction
adryanbub
 
PPTX
SQL Server 2016 New Features and Enhancements
John Martin
 
PDF
Live Query Statistics & Query Store in SQL Server 2016
Antonios Chatzipavlis
 
PDF
Statistics and Indexes Internals
Antonios Chatzipavlis
 
PPTX
Oracle Autonomous Database for Developers
Tércio Costa
 
PDF
Microsoft SQL Family and GDPR
Antonios Chatzipavlis
 
PPTX
SQL server 2016 New Features
Amin Mesbahi
 
PDF
SQL Server 2016 Editions
Onomi
 
PPTX
SQL Server 2016: Just a Few of Our DBA's Favorite Things
Hostway|HOSTING
 
PPTX
Stretch Database
SolidQ
 
PDF
Machine Learning in SQL Server 2019
Antonios Chatzipavlis
 
PPTX
Sql server troubleshooting
Nathan Winters
 
PPTX
Everything you need to know about SQL Server 2016
Softchoice Corporation
 
PPTX
SQL Server 2016 new features
SpanishPASSVC
 
PPTX
Geek Sync | SQL Security Principals and Permissions 101
IDERA Software
 
PPTX
Geek Sync | Data Integrity Demystified - Deborah Melkin | IDERA
IDERA Software
 
Introduction to sql database on azure
Antonios Chatzipavlis
 
Implementing Mobile Reports in SQL Sserver 2016 Reporting Services
Antonios Chatzipavlis
 
Scalable relational database with SQL Azure
Shy Engelberg
 
SQL Server 2016 BI updates
Chris Testa-O'Neill
 
Oracle Query Optimizer - An Introduction
adryanbub
 
SQL Server 2016 New Features and Enhancements
John Martin
 
Live Query Statistics & Query Store in SQL Server 2016
Antonios Chatzipavlis
 
Statistics and Indexes Internals
Antonios Chatzipavlis
 
Oracle Autonomous Database for Developers
Tércio Costa
 
Microsoft SQL Family and GDPR
Antonios Chatzipavlis
 
SQL server 2016 New Features
Amin Mesbahi
 
SQL Server 2016 Editions
Onomi
 
SQL Server 2016: Just a Few of Our DBA's Favorite Things
Hostway|HOSTING
 
Stretch Database
SolidQ
 
Machine Learning in SQL Server 2019
Antonios Chatzipavlis
 
Sql server troubleshooting
Nathan Winters
 
Everything you need to know about SQL Server 2016
Softchoice Corporation
 
SQL Server 2016 new features
SpanishPASSVC
 
Geek Sync | SQL Security Principals and Permissions 101
IDERA Software
 
Geek Sync | Data Integrity Demystified - Deborah Melkin | IDERA
IDERA Software
 

Similar to Using extended events for troubleshooting sql server (20)

PPTX
Extended Events 101 : Japan SQL Server User Group
Kenichiro Nakamura
 
PPTX
Responding to extended events in near real time
Gianluca Sartori
 
PPTX
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
sqlserver.co.il
 
PPTX
Extended events to the rescue
madeiradata
 
PPTX
Extended Events in Action
Miroslav Dimitrov
 
PPTX
Geek Sync | Extended Events: What Are They and How Do I Use Them?
IDERA Software
 
PPTX
Extended events
Jonathan Allen
 
PDF
SQL 2014-Extended Event
Mindfire Solutions
 
PPTX
SQL Server Extended Events presentation from SQL Midlands User Group 14th Mar...
Stuart Moore
 
PPTX
SQL Server Extended Events
Stuart Moore
 
PDF
Complex Event Processing with Esper
António Alegria
 
PPTX
Using Extended Events
SQL Server Sri Lanka User Group
 
PDF
What are you waiting for? (#SQLSat211)
Jason Strate
 
PDF
What are you waiting for
Jason Strate
 
PPTX
04_DP_300T00A_Monitor.pptx
KareemBullard1
 
PDF
Soa12c launch 5 event processing shmakov eng cr
Vasily Demin
 
PPT
Event Logs: What kind of data does process mining require?
Wil van der Aalst
 
PPTX
Event Driven Architectures - Phoenix Java Users Group 2013
clairvoyantllc
 
PDF
Event Stream Processing SAP
Gaurav Ahluwalia
 
PDF
Speeding up big data with event processing
Alexandre de Castro Alves
 
Extended Events 101 : Japan SQL Server User Group
Kenichiro Nakamura
 
Responding to extended events in near real time
Gianluca Sartori
 
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
sqlserver.co.il
 
Extended events to the rescue
madeiradata
 
Extended Events in Action
Miroslav Dimitrov
 
Geek Sync | Extended Events: What Are They and How Do I Use Them?
IDERA Software
 
Extended events
Jonathan Allen
 
SQL 2014-Extended Event
Mindfire Solutions
 
SQL Server Extended Events presentation from SQL Midlands User Group 14th Mar...
Stuart Moore
 
SQL Server Extended Events
Stuart Moore
 
Complex Event Processing with Esper
António Alegria
 
Using Extended Events
SQL Server Sri Lanka User Group
 
What are you waiting for? (#SQLSat211)
Jason Strate
 
What are you waiting for
Jason Strate
 
04_DP_300T00A_Monitor.pptx
KareemBullard1
 
Soa12c launch 5 event processing shmakov eng cr
Vasily Demin
 
Event Logs: What kind of data does process mining require?
Wil van der Aalst
 
Event Driven Architectures - Phoenix Java Users Group 2013
clairvoyantllc
 
Event Stream Processing SAP
Gaurav Ahluwalia
 
Speeding up big data with event processing
Alexandre de Castro Alves
 
Ad

More from Antonios Chatzipavlis (20)

PPTX
Data virtualization using polybase
Antonios Chatzipavlis
 
PDF
Migrate SQL Workloads to Azure
Antonios Chatzipavlis
 
PDF
Workload Management in SQL Server 2019
Antonios Chatzipavlis
 
PDF
Loading Data into Azure SQL DW (Synapse Analytics)
Antonios Chatzipavlis
 
PDF
Introduction to DAX Language
Antonios Chatzipavlis
 
PDF
Building diagnostic queries using DMVs and DMFs
Antonios Chatzipavlis
 
PDF
Exploring T-SQL Anti-Patterns
Antonios Chatzipavlis
 
PDF
Designing a modern data warehouse in azure
Antonios Chatzipavlis
 
PDF
Modernizing your database with SQL Server 2019
Antonios Chatzipavlis
 
PDF
Designing a modern data warehouse in azure
Antonios Chatzipavlis
 
PDF
SQLServer Database Structures
Antonios Chatzipavlis
 
PDF
Sqlschool 2017 recap - 2018 plans
Antonios Chatzipavlis
 
PDF
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Antonios Chatzipavlis
 
PDF
Introduction to Azure Data Lake
Antonios Chatzipavlis
 
PDF
Azure SQL Data Warehouse
Antonios Chatzipavlis
 
PDF
Introduction to azure document db
Antonios Chatzipavlis
 
PDF
Introduction to Machine Learning on Azure
Antonios Chatzipavlis
 
PDF
Auditing Data Access in SQL Server
Antonios Chatzipavlis
 
PDF
Exploring sql server 2016 bi
Antonios Chatzipavlis
 
PDF
Dynamic data masking sql server 2016
Antonios Chatzipavlis
 
Data virtualization using polybase
Antonios Chatzipavlis
 
Migrate SQL Workloads to Azure
Antonios Chatzipavlis
 
Workload Management in SQL Server 2019
Antonios Chatzipavlis
 
Loading Data into Azure SQL DW (Synapse Analytics)
Antonios Chatzipavlis
 
Introduction to DAX Language
Antonios Chatzipavlis
 
Building diagnostic queries using DMVs and DMFs
Antonios Chatzipavlis
 
Exploring T-SQL Anti-Patterns
Antonios Chatzipavlis
 
Designing a modern data warehouse in azure
Antonios Chatzipavlis
 
Modernizing your database with SQL Server 2019
Antonios Chatzipavlis
 
Designing a modern data warehouse in azure
Antonios Chatzipavlis
 
SQLServer Database Structures
Antonios Chatzipavlis
 
Sqlschool 2017 recap - 2018 plans
Antonios Chatzipavlis
 
Azure SQL Database for the SQL Server DBA - Azure Bootcamp Athens 2018
Antonios Chatzipavlis
 
Introduction to Azure Data Lake
Antonios Chatzipavlis
 
Azure SQL Data Warehouse
Antonios Chatzipavlis
 
Introduction to azure document db
Antonios Chatzipavlis
 
Introduction to Machine Learning on Azure
Antonios Chatzipavlis
 
Auditing Data Access in SQL Server
Antonios Chatzipavlis
 
Exploring sql server 2016 bi
Antonios Chatzipavlis
 
Dynamic data masking sql server 2016
Antonios Chatzipavlis
 
Ad

Using extended events for troubleshooting sql server

  • 1. CHAPTER Using Extended Events for Troubleshooting SQL Server Antonios Chatzipavlis SQLschool.gr Founder, Principal Consultant SQL Server Evangelist, MVP on SQL Server June 4, 2015
  • 2. 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 Chatzipavlis Database Architect SQL Server Evangelist MCT, MCSE, MCITP, MCPD, MCSD, MCDBA, MCSA, MCTS, MCAD, MCP, OCA, ITIL-F 1982 1988 1996 1998 2010 2012 2013 CHAPTER
  • 3. Follow us in social media Twitter @antoniosch / @sqlschool Facebook fb/sqlschoolgr YouTube yt/user/achatzipavlis LinkedIn SQL School Greece group Pinterest pi/SQLschool/
  • 5. Extended Events was introduced in SQL Server 2008 as a new method of collecting diagnostic data from SQL Server
  • 6. • 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?
  • 7. • Events Mapping Query • Column to Action Mapping Query Switch from SQL Trace to XEvents select xe.xe_event_name,st.name from sys.trace_xe_event_map as xe inner join sys.trace_events as st on xe.trace_event_id = st.trace_event_id; select xe.xe_action_name, tc.name from sys.trace_xe_action_map as xe inner join sys.trace_columns as tc on xe.trace_column_id = tc.trace_column_id;
  • 8. • 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
  • 9. Event Life Cycle Event point encountered in code Is Event Enabled in a session Code 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
  • 10. • 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
  • 11. • 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
  • 12. • 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
  • 13. DEMO CHAPTER Use case scenarios of Extended Events
  • 15. • Live Query Stats (LQS) • Query Store SQL Server 2016