SlideShare a Scribd company logo
Japan SQL Server User Group
Kenichiro Nakamura
Oct/20 2018
Extended Events 101
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.
• 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
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
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
New Session Wizard
Demo
Engine, Sessions, Packages
Extended Events Components
Extended Event Engine
Extended Events Engine
Extended Events Sessions
Extended Events Sessions
Extended Events Sessions
Extended Events Sessions
Components
Event/Target/Predicate/Actions
State
Start/Stop (on boot)
Causality tracking
Relate events
Memory
Retention mode, partition mode (3)
Dispatch
latency (30)
Extended Events Packages
Extended Events Packages
• 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
New Session
Demo
Edit Session
Demo
Channel
Grouping of category
Category
Grouping of event
Event
Event name
Payload
Default and additional
Event
Events
Target
Targets
Target = Event Consumer
Basic
Raw data
Aggregate
Aggregated Data
Target
Targets
Target Timing
Synchronous
Asynchronous
Dispatching when:
Memory Full
Dispatch Latency (30)
Target
Targets
Event File (Raw, Async, On-Disk)
Event Counter (Aggregate, Async, In-Memory)
Histogram(Aggregate by bucket, Async, In-Memory)
ETW (Raw, Sync, On-Disk)
Event Paring (Aggregate, Async, In-Memory)
Ring Buffer (Raw, Async, In-Memory)
select * from sys.dm_xe_session_targets
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
Predicates
Events
Predicates = Filter
Different filter for each event
Short Circuit
i.e.) greater_than_max_int64
Advanced Predicate
Demo
Object Explorer in SSMS
Extended Events Tool
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
Create Extended Events Template
Manage Extended Events Sessions
Start Session
Stop Session
Watch Live Data
Export Session
Script Session
Delete Session
Modify the Trace Results View
Modify the Trace Results View
Add/Remove Columns
Create/Edit/Delete Merged Columns
Sort
Group
Aggregate
Filter
Search
Modify the Trace Results View
Demo
© Copyright Kenichiro Nakamura. All rights reserved.

More Related Content

PPTX
Simplify Complex Query with CQRS
PPTX
Google Cloud Spanner Preview
PDF
PDF
Cassandra as event sourced journal for big data analytics
PDF
Net app course content
PDF
Realizing the Event Driven Enterprise
PDF
Kyryl Sablin Crdt and their uses
PDF
The Old New Crash: Cloud Memory Dump Analysis
Simplify Complex Query with CQRS
Google Cloud Spanner Preview
Cassandra as event sourced journal for big data analytics
Net app course content
Realizing the Event Driven Enterprise
Kyryl Sablin Crdt and their uses
The Old New Crash: Cloud Memory Dump Analysis

What's hot (20)

PDF
Azure Stream Analytics Project : On-demand real-time analytics
PDF
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
PPTX
Analyzing StackExchange Data with Azure Data Lake (Tom Kerkhove @ Integration...
PPTX
Deploying, Backups, and Restore w Datastax + Azure at Albertsons/Safeway (Gur...
PPTX
TechDays NL 2016 - Building your scalable secure IoT Solution on Azure
PPTX
Complex Event Processing - A brief overview
PDF
You might be paying too much for BigQuery
PPTX
Accumulo Summit 2015: Building Aggregation Systems on Accumulo [Leveraging Ac...
PPTX
Azure synapse by usama whaba khan
PDF
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
PDF
Engineering fast indexes
PDF
Raven DB; day to day
PPTX
Analytics in the Cloud
PDF
BigQuery for Beginners
PPTX
Introduction to WSO2 Data Analytics Platform
PPTX
Integration Monday - Analysing StackExchange data with Azure Data Lake
PDF
React with D3: DOM Manipulation Orchestration
PPTX
Azure data lake sql konf 2016
PPTX
Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016
PDF
Azure Stream Analytics Project : On-demand real-time analytics
Large volume data analysis on the Typesafe Reactive Platform - Big Data Scala...
Analyzing StackExchange Data with Azure Data Lake (Tom Kerkhove @ Integration...
Deploying, Backups, and Restore w Datastax + Azure at Albertsons/Safeway (Gur...
TechDays NL 2016 - Building your scalable secure IoT Solution on Azure
Complex Event Processing - A brief overview
You might be paying too much for BigQuery
Accumulo Summit 2015: Building Aggregation Systems on Accumulo [Leveraging Ac...
Azure synapse by usama whaba khan
codecentric AG: CQRS and Event Sourcing Applications with Cassandra
Engineering fast indexes
Raven DB; day to day
Analytics in the Cloud
BigQuery for Beginners
Introduction to WSO2 Data Analytics Platform
Integration Monday - Analysing StackExchange data with Azure Data Lake
React with D3: DOM Manipulation Orchestration
Azure data lake sql konf 2016
Lambda Architecture with Cassandra (Vaibhav Puranik, GumGum) | C* Summit 2016
Ad

Similar to Extended Events 101 : Japan SQL Server User Group (20)

PDF
Using extended events for troubleshooting sql server
PPTX
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
PPTX
04_DP_300T00A_Monitor.pptx
PPTX
Building stateful serverless orchestrations with Azure Durable Azure Function...
PPT
Performance Monitoring And Tuning In Sql Server 2008 Tsql
PPTX
Microsoft SQL Server - StreamInsight Overview Presentation
PDF
Dell Storage Management
PPTX
How we evolved data pipeline at Celtra and what we learned along the way
PPTX
Responding to extended events in near real time
PPSX
Sql server lesson12
PPTX
Sql server lesson12
PPTX
Server monitoring made easy with Applications Manager
PDF
Analysis of Database Issues using AHF and Machine Learning v2 - SOUG
PDF
Self-serve analytics journey at Celtra: Snowflake, Spark, and Databricks
PPT
Saying goodbye to SQL Server 2000
PDF
How to Create Observable Integration Solutions Using WSO2 Enterprise Integrator
PDF
Session 2: SQL Server 2012 with Christian Malbeuf
PPTX
Performance eng prakash.sahu
PPTX
Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...
PPTX
SQL Server and System Center Advisor
Using extended events for troubleshooting sql server
SQL Explore 2012 - Tzahi Hakikat and Keren Bartal: Extended Events
04_DP_300T00A_Monitor.pptx
Building stateful serverless orchestrations with Azure Durable Azure Function...
Performance Monitoring And Tuning In Sql Server 2008 Tsql
Microsoft SQL Server - StreamInsight Overview Presentation
Dell Storage Management
How we evolved data pipeline at Celtra and what we learned along the way
Responding to extended events in near real time
Sql server lesson12
Sql server lesson12
Server monitoring made easy with Applications Manager
Analysis of Database Issues using AHF and Machine Learning v2 - SOUG
Self-serve analytics journey at Celtra: Snowflake, Spark, and Databricks
Saying goodbye to SQL Server 2000
How to Create Observable Integration Solutions Using WSO2 Enterprise Integrator
Session 2: SQL Server 2012 with Christian Malbeuf
Performance eng prakash.sahu
Data to Insight in a Flash: Introduction to Real-Time Analytics with WSO2 Com...
SQL Server and System Center Advisor
Ad

More from Kenichiro Nakamura (20)

PPTX
JSSUG Azure SQL Analytics
PDF
LINE Developer Day 2019 how to optimize bot development lifecycle with dev ops
PPTX
MTDDC 2019 LINE ボットからみた MT Data API の可能性
PPTX
Tokyo Azure Meetup #29 AKS
PPTX
TypeScript Meetup #1 Build 2019 update
PDF
ボット開発でも DevOps! BotBuilder のテスト手法
PPTX
.NET ラボ 勉強会 C# でラインプラットフォーム開発
PPTX
Microsoft Azure Cognitive Services
PPTX
EdgeAI: Azure IoT Edge カスタムモジュール開発
PPTX
エッジ・組み込みAI勉強会 : コンテナで使う Cognitive Service
PPTX
SQL Server 2019 Master Data Service
PPTX
いま考えられる限り最も速く対話型アプリを開発する方法
PDF
Azure for hackathon
PPTX
Tech-on Meet Up #02 Microsoft のコンテナ活用事例
PPTX
JSSUG: SQL Sever Index Tuning
PPTX
JSSUG: SQL Sever Performance Tuning
PPTX
LT: 開発者が意識するべき チャットボットの UX と アーキテクチャ
PDF
今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介
PPTX
LINE Bot リッチメニュー使ってる?
PPTX
Line Bot with C#
JSSUG Azure SQL Analytics
LINE Developer Day 2019 how to optimize bot development lifecycle with dev ops
MTDDC 2019 LINE ボットからみた MT Data API の可能性
Tokyo Azure Meetup #29 AKS
TypeScript Meetup #1 Build 2019 update
ボット開発でも DevOps! BotBuilder のテスト手法
.NET ラボ 勉強会 C# でラインプラットフォーム開発
Microsoft Azure Cognitive Services
EdgeAI: Azure IoT Edge カスタムモジュール開発
エッジ・組み込みAI勉強会 : コンテナで使う Cognitive Service
SQL Server 2019 Master Data Service
いま考えられる限り最も速く対話型アプリを開発する方法
Azure for hackathon
Tech-on Meet Up #02 Microsoft のコンテナ活用事例
JSSUG: SQL Sever Index Tuning
JSSUG: SQL Sever Performance Tuning
LT: 開発者が意識するべき チャットボットの UX と アーキテクチャ
今更聞けない!?Microsoft Graph で始める Office 365 データ活用と事例の紹介
LINE Bot リッチメニュー使ってる?
Line Bot with C#

Recently uploaded (20)

PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPTX
Spectroscopy.pptx food analysis technology
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Network Security Unit 5.pdf for BCA BBA.
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PPT
Teaching material agriculture food technology
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
PPTX
Cloud computing and distributed systems.
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
“AI and Expert System Decision Support & Business Intelligence Systems”
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Spectroscopy.pptx food analysis technology
Understanding_Digital_Forensics_Presentation.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Encapsulation_ Review paper, used for researhc scholars
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Mobile App Security Testing_ A Comprehensive Guide.pdf
Digital-Transformation-Roadmap-for-Companies.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Network Security Unit 5.pdf for BCA BBA.
Per capita expenditure prediction using model stacking based on satellite ima...
Teaching material agriculture food technology
Chapter 3 Spatial Domain Image Processing.pdf
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
Cloud computing and distributed systems.
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Build a system with the filesystem maintained by OSTree @ COSCUP 2025

Extended Events 101 : Japan SQL Server User Group

  • 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
  • 10. Extended Events Sessions Extended Events Sessions Components Event/Target/Predicate/Actions State Start/Stop (on boot) Causality tracking Relate events Memory Retention mode, partition mode (3) Dispatch latency (30)
  • 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
  • 15. Channel Grouping of category Category Grouping of event Event Event name Payload Default and additional Event Events
  • 16. Target Targets Target = Event Consumer Basic Raw data Aggregate Aggregated Data
  • 18. Target Targets Event File (Raw, Async, On-Disk) Event Counter (Aggregate, Async, In-Memory) Histogram(Aggregate by bucket, Async, In-Memory) ETW (Raw, Sync, On-Disk) Event Paring (Aggregate, Async, In-Memory) Ring Buffer (Raw, Async, In-Memory) select * from sys.dm_xe_session_targets
  • 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
  • 20. Predicates Events Predicates = Filter Different filter for each event Short Circuit i.e.) greater_than_max_int64
  • 22. Object Explorer in SSMS Extended Events Tool
  • 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
  • 25. Manage Extended Events Sessions Start Session Stop Session Watch Live Data Export Session Script Session Delete Session
  • 26. Modify the Trace Results View Modify the Trace Results View Add/Remove Columns Create/Edit/Delete Merged Columns Sort Group Aggregate Filter Search
  • 27. Modify the Trace Results View Demo
  • 28. © Copyright Kenichiro Nakamura. All rights reserved.

Editor's Notes

  • #7: Use wizard to capture sql_statement_completed and batch_sql_completed
  • #8: Use wizard to capture sql_statement_completed and batch_sql_completed
  • #14: Use wizard to capture sql_statement_completed and batch_sql_completed
  • #15: Use wizard to capture sql_statement_completed and batch_sql_completed
  • #22: Use wizard to capture sql_statement_completed and batch_sql_completed
  • #23: Use wizard to capture sql_statement_completed and batch_sql_completed
  • #28: Use wizard to capture sql_statement_completed and batch_sql_completed