SlideShare a Scribd company logo
1 of 24
Responding to Extended Events
in (near) Real-Time
Gianluca Sartori
sqlconsulting.it
Thank you to our sponsors!
Gianluca Sartori
 Independent SQL Server consultant
 SQL Server MVP, MCTS, MCITP, MCT
 Works with SQL Server since version 7
 DBA @ Scuderia Ferrari
 Blog: spaghettidba.com
 Twitter: @spaghettidba
Agenda
 Extended Events Core Concepts
 Streaming Extended Events
 Possible Applications
 Extended T-SQL Collector
Monitoring
 Goals:
 Troubleshooting
What happened tonight at 03:40?
 Tune performance
Which queries consume most resources?
 Capacity Planning
How fast are my databases growing?
 Baselining
Is the system behaving normally?
 Alerting
Hey, look: something’s wrong here!
How should I monitor?
 Buy a commercial suite
 SQLSentry, RedGate, SolarWinds, Dell…
 Big value, Big money 
 Use open source/free tools
 Often unreliable/incomplete 
 Code your own
 Are you sure? 
 Use SQL Server built-in tools
 SQL Trace
 Event Notifications
 Alerts
 Extended Events
Extended Events
 Replacement for SQL Trace
 Introduced in 2008
 Real replacement from version >= 2012
 Lightweight event capture infrastructure
 Deep inside SQLOS
 Low performance overhead
 Allows capturing events not available otherwise
Extended Events – Concepts
 Event
 Fired by SQLOS when a point in code is reached
 Contains information  Fields
 Action
 Additional operations performed when event fires
 Adds more data to the event
Extended Events – Concepts
 Session
 Defines what we want to capture and how we do it
 Events + Fields + Actions = Session
 Target
 Event consumer
 Several types of targets
 Multiple targets for the same session
 A session does not necessarily need a target
Extended Events – Concepts
 Targets
 BOL describes 6 types of targets:
http://technet.microsoft.com/en-us/library/bb630339.aspx
Name Description
Ring buffer Use to hold the event data in memory on a first-in first-out (FIFO) basis
Event file Use to write event session output from complete memory buffers to disk.
Event pairing Use to determine when a specified paired event does not occur in a
matched set.
Event Tracing for
Windows (ETW)
Use to correlate SQL Server events with Windows operating system or
application event data.
Event counter Counts all specified events that occur during an Extended Events session.
Histogram Use to count the number of times that a specified event occurs
Extended Events – Missing something?
 No built-in alerting target
 Connect item for SB target (Won’t fix)
 http://bit.ly/1A8HqG0
 Possible solutions:
 Post-process the target  not fast enough
 Poll the target for changes  ugly
 Use something else
 Alerts
 Event notifications
A Hidden Target Type
 Watch Live Data
 How does it work?
SELECT *
FROM sys.dm_xe_session_targets
DEMO
Extended Events Streaming API
Displaying Captured Events
Streaming Extended Events
 Possible Applications:
 Watch events as they occur
 Perform actions in response to an event
 Alert when specific events are raised
 Does not make sense for all events
 Save events to a target database
DEMO
Streaming API in C#
Replaying a Workload
Streaming Extended Events
 Downsides
 Not fully available in the T-SQL realm
 DBAs need to learn C# ???
 Streaming API is available in PowerShell
 SQLAgent job with PoSh step
 Background process running PoSh script
DEMO
Streaming API in Powershell
Capturing Successful Logon Events
Streaming Extended Events
 Saving events to a database table
 Capture some data, save to a database
 Sounds familiar, doesn’t it?
 Data Collector
 Needs a specialized Collector Type for XE stream
Introducing Extended T-SQL Collector
 Provides a GUI for the Data Collector
 Incorporates 2 new collector types:
 Extended TSQL Collector Type
 Adds support for LOB columns
 Extended XE Reader Collector Type
 Reads data from Extended Events sessions
 Incorporates alerting
 Free and Open Source
http://extendedtsqlcollector.codeplex.com
DEMO
Working with Extended T-SQL Collector
Bottom line
 Streaming API is a lesser known target type
 Provides a convenient way to process events
as they occur
 Some coding required
 Extended T-SQL Collector to the rescue!
Resources
 Extended T-SQL Collector
http://extendedtsqlcollector.codeplex.com
 Monitoring Blocking and Deadlocking with
Extended T-SQL Collector
http://spaghettidba.com/2014/12/12/monitoring-blocking-and-deadlocking-
with-extended-t-sql-collector/
 Tracking Table Usage with Extended Events
http://spaghettidba.com/2015/04/20/tracking-table-usage-and-identifying-
unused-objects/
 Reacting to Extended Events in almost real-time
http://www.sqlskills.com/blogs/bobb/reacting-to-xevents-in-almost-real-time/
Q&A
Questions?
Your feedback is important!
Please let us know what you thought of this session 
http://sqlsaturday.com/414/sessions/sessionevaluation.aspx

More Related Content

What's hot

Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec glory
Priyanka Aash
 

What's hot (20)

If Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocsIf Hemingway Wrote JavaDocs
If Hemingway Wrote JavaDocs
 
DevOps Spain 2019. Beatriz Martínez-IBM
DevOps Spain 2019. Beatriz Martínez-IBMDevOps Spain 2019. Beatriz Martínez-IBM
DevOps Spain 2019. Beatriz Martínez-IBM
 
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache TomcatCase Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
Case Study: Migrating Hyperic from EJB to Spring from JBoss to Apache Tomcat
 
How to secure your web applications with NGINX
How to secure your web applications with NGINXHow to secure your web applications with NGINX
How to secure your web applications with NGINX
 
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
MJC 2021: "Debugging Java Microservices Running on Kubernetes with Telepresence"
 
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
Top .NET, Java & Web Performance Mistakes - Meetup Jan 2015
 
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
BTD2015 - Your Place In DevTOps is Finding Solutions - Not Just Bugs!
 
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
#NoXML: Eliminating XML in Spring Projects - SpringOne 2GX 2015
 
Lecture 11 Firebase overview
Lecture 11 Firebase overviewLecture 11 Firebase overview
Lecture 11 Firebase overview
 
How to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in RundeckHow to Build a Custom Plugin in Rundeck
How to Build a Custom Plugin in Rundeck
 
I Am MongoDB – And So Can You!
I Am MongoDB – And So Can You!I Am MongoDB – And So Can You!
I Am MongoDB – And So Can You!
 
HATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API StyleHATEOAS 101 - Opinionated Introduction to a REST API Style
HATEOAS 101 - Opinionated Introduction to a REST API Style
 
What it feels like to live in a Security Enabled DevOps World
What it feels like to live in a Security Enabled DevOps WorldWhat it feels like to live in a Security Enabled DevOps World
What it feels like to live in a Security Enabled DevOps World
 
BsidesMCR_2016-what-can-infosec-learn-from-devops
BsidesMCR_2016-what-can-infosec-learn-from-devopsBsidesMCR_2016-what-can-infosec-learn-from-devops
BsidesMCR_2016-what-can-infosec-learn-from-devops
 
不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon不只自動化而且更敏捷的Android開發工具 gradle mopcon
不只自動化而且更敏捷的Android開發工具 gradle mopcon
 
London WebPerf Meetup: End-To-End Performance Problems
London WebPerf Meetup: End-To-End Performance ProblemsLondon WebPerf Meetup: End-To-End Performance Problems
London WebPerf Meetup: End-To-End Performance Problems
 
Lecture 10 Networking on Mobile Devices
Lecture 10 Networking on Mobile DevicesLecture 10 Networking on Mobile Devices
Lecture 10 Networking on Mobile Devices
 
It's a Dangerous World
It's a Dangerous World It's a Dangerous World
It's a Dangerous World
 
InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017InSpec Workshop DevSecCon 2017
InSpec Workshop DevSecCon 2017
 
Abusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec gloryAbusing bleeding edge web standards for appsec glory
Abusing bleeding edge web standards for appsec glory
 

Similar to Responding to extended events in near real time

Similar to Responding to extended events in near real time (20)

Semantic logging with etw and slab from DCC 10/16
Semantic logging with etw and slab from DCC 10/16Semantic logging with etw and slab from DCC 10/16
Semantic logging with etw and slab from DCC 10/16
 
What is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
What is going on? Application Diagnostics on Azure - Copenhagen .NET User GroupWhat is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
What is going on? Application Diagnostics on Azure - Copenhagen .NET User Group
 
Using extended events for troubleshooting sql server
Using extended events for troubleshooting sql serverUsing extended events for troubleshooting sql server
Using extended events for troubleshooting sql server
 
SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
Play framework : A Walkthrough
Play framework : A WalkthroughPlay framework : A Walkthrough
Play framework : A Walkthrough
 
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...Admin Tech Clash: Discussing Best (and Worst) Administration Practices from  ...
Admin Tech Clash: Discussing Best (and Worst) Administration Practices from ...
 
Agile Testing Days 2017 Introducing AgileBI Sustainably
Agile Testing Days 2017 Introducing AgileBI SustainablyAgile Testing Days 2017 Introducing AgileBI Sustainably
Agile Testing Days 2017 Introducing AgileBI Sustainably
 
1 Win7 For Devs Fund Search
1 Win7 For Devs Fund Search1 Win7 For Devs Fund Search
1 Win7 For Devs Fund Search
 
Soprex framework on .net in action
Soprex framework on .net in actionSoprex framework on .net in action
Soprex framework on .net in action
 
Windows 7 Seminar - Acend Corporate Learning
Windows 7 Seminar - Acend Corporate LearningWindows 7 Seminar - Acend Corporate Learning
Windows 7 Seminar - Acend Corporate Learning
 
Azure Serverless with Functions, Logic Apps, and Event Grid
Azure Serverless with Functions, Logic Apps, and Event Grid  Azure Serverless with Functions, Logic Apps, and Event Grid
Azure Serverless with Functions, Logic Apps, and Event Grid
 
10tait
10tait10tait
10tait
 
Chapter 10
Chapter 10 Chapter 10
Chapter 10
 
Stating the obvious - 121 Test Automation Day, Dublin, 2018
Stating the obvious - 121 Test Automation Day, Dublin, 2018Stating the obvious - 121 Test Automation Day, Dublin, 2018
Stating the obvious - 121 Test Automation Day, Dublin, 2018
 
ASPNET for PHP Developers
ASPNET for PHP DevelopersASPNET for PHP Developers
ASPNET for PHP Developers
 
Complex Event Processing - A brief overview
Complex Event Processing - A brief overviewComplex Event Processing - A brief overview
Complex Event Processing - A brief overview
 
Road to database automation: database source control
Road to database automation: database source controlRoad to database automation: database source control
Road to database automation: database source control
 
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel Lavoie
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel LavoieSpring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel Lavoie
Spring Boot & Spring Cloud Apps on Pivotal Application Service - Daniel Lavoie
 
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
SpringOne Tour Denver - Spring Boot & Spring Cloud on Pivotal Application Ser...
 
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
SharePoint Intelligence Extending Share Point Designer 2010 Workflows With Cu...
 

More from Gianluca Sartori

More from Gianluca Sartori (10)

Benchmarking like a pro
Benchmarking like a proBenchmarking like a pro
Benchmarking like a pro
 
Sql server infernals
Sql server infernalsSql server infernals
Sql server infernals
 
SQL Server 2016 New Security Features
SQL Server 2016 New Security FeaturesSQL Server 2016 New Security Features
SQL Server 2016 New Security Features
 
Sql server security in an insecure world
Sql server security in an insecure worldSql server security in an insecure world
Sql server security in an insecure world
 
SQL Server Worst Practices - EN
SQL Server Worst Practices - ENSQL Server Worst Practices - EN
SQL Server Worst Practices - EN
 
TSQL Advanced Query Techniques
TSQL Advanced Query TechniquesTSQL Advanced Query Techniques
TSQL Advanced Query Techniques
 
My Query is slow, now what?
My Query is slow, now what?My Query is slow, now what?
My Query is slow, now what?
 
SQL Server Benchmarking, Baselining and Workload Analysis
SQL Server Benchmarking, Baselining and Workload AnalysisSQL Server Benchmarking, Baselining and Workload Analysis
SQL Server Benchmarking, Baselining and Workload Analysis
 
A performance tuning methodology
A performance tuning methodologyA performance tuning methodology
A performance tuning methodology
 
SQL Server Worst Practices
SQL Server Worst PracticesSQL Server Worst Practices
SQL Server Worst Practices
 

Recently uploaded

Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Victor Rentea
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 

Recently uploaded (20)

EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 

Responding to extended events in near real time

  • 1. Responding to Extended Events in (near) Real-Time Gianluca Sartori sqlconsulting.it
  • 2. Thank you to our sponsors!
  • 3. Gianluca Sartori  Independent SQL Server consultant  SQL Server MVP, MCTS, MCITP, MCT  Works with SQL Server since version 7  DBA @ Scuderia Ferrari  Blog: spaghettidba.com  Twitter: @spaghettidba
  • 4. Agenda  Extended Events Core Concepts  Streaming Extended Events  Possible Applications  Extended T-SQL Collector
  • 5. Monitoring  Goals:  Troubleshooting What happened tonight at 03:40?  Tune performance Which queries consume most resources?  Capacity Planning How fast are my databases growing?  Baselining Is the system behaving normally?  Alerting Hey, look: something’s wrong here!
  • 6. How should I monitor?  Buy a commercial suite  SQLSentry, RedGate, SolarWinds, Dell…  Big value, Big money   Use open source/free tools  Often unreliable/incomplete   Code your own  Are you sure?   Use SQL Server built-in tools  SQL Trace  Event Notifications  Alerts  Extended Events
  • 7. Extended Events  Replacement for SQL Trace  Introduced in 2008  Real replacement from version >= 2012  Lightweight event capture infrastructure  Deep inside SQLOS  Low performance overhead  Allows capturing events not available otherwise
  • 8. Extended Events – Concepts  Event  Fired by SQLOS when a point in code is reached  Contains information  Fields  Action  Additional operations performed when event fires  Adds more data to the event
  • 9. Extended Events – Concepts  Session  Defines what we want to capture and how we do it  Events + Fields + Actions = Session  Target  Event consumer  Several types of targets  Multiple targets for the same session  A session does not necessarily need a target
  • 10. Extended Events – Concepts  Targets  BOL describes 6 types of targets: http://technet.microsoft.com/en-us/library/bb630339.aspx Name Description Ring buffer Use to hold the event data in memory on a first-in first-out (FIFO) basis Event file Use to write event session output from complete memory buffers to disk. Event pairing Use to determine when a specified paired event does not occur in a matched set. Event Tracing for Windows (ETW) Use to correlate SQL Server events with Windows operating system or application event data. Event counter Counts all specified events that occur during an Extended Events session. Histogram Use to count the number of times that a specified event occurs
  • 11. Extended Events – Missing something?  No built-in alerting target  Connect item for SB target (Won’t fix)  http://bit.ly/1A8HqG0  Possible solutions:  Post-process the target  not fast enough  Poll the target for changes  ugly  Use something else  Alerts  Event notifications
  • 12. A Hidden Target Type  Watch Live Data  How does it work? SELECT * FROM sys.dm_xe_session_targets
  • 13. DEMO Extended Events Streaming API Displaying Captured Events
  • 14. Streaming Extended Events  Possible Applications:  Watch events as they occur  Perform actions in response to an event  Alert when specific events are raised  Does not make sense for all events  Save events to a target database
  • 15. DEMO Streaming API in C# Replaying a Workload
  • 16. Streaming Extended Events  Downsides  Not fully available in the T-SQL realm  DBAs need to learn C# ???  Streaming API is available in PowerShell  SQLAgent job with PoSh step  Background process running PoSh script
  • 17. DEMO Streaming API in Powershell Capturing Successful Logon Events
  • 18. Streaming Extended Events  Saving events to a database table  Capture some data, save to a database  Sounds familiar, doesn’t it?  Data Collector  Needs a specialized Collector Type for XE stream
  • 19. Introducing Extended T-SQL Collector  Provides a GUI for the Data Collector  Incorporates 2 new collector types:  Extended TSQL Collector Type  Adds support for LOB columns  Extended XE Reader Collector Type  Reads data from Extended Events sessions  Incorporates alerting  Free and Open Source http://extendedtsqlcollector.codeplex.com
  • 20. DEMO Working with Extended T-SQL Collector
  • 21. Bottom line  Streaming API is a lesser known target type  Provides a convenient way to process events as they occur  Some coding required  Extended T-SQL Collector to the rescue!
  • 22. Resources  Extended T-SQL Collector http://extendedtsqlcollector.codeplex.com  Monitoring Blocking and Deadlocking with Extended T-SQL Collector http://spaghettidba.com/2014/12/12/monitoring-blocking-and-deadlocking- with-extended-t-sql-collector/  Tracking Table Usage with Extended Events http://spaghettidba.com/2015/04/20/tracking-table-usage-and-identifying- unused-objects/  Reacting to Extended Events in almost real-time http://www.sqlskills.com/blogs/bobb/reacting-to-xevents-in-almost-real-time/
  • 24. Your feedback is important! Please let us know what you thought of this session  http://sqlsaturday.com/414/sessions/sessionevaluation.aspx

Editor's Notes

  1. Platinum: Capgemini, Evry Gold: Microsoft, Webstep, Glasspaper, NextBridge, Violin Memory Silver: Computas Bronze: Varigence, SQLSentry, Cozyroc Swag: ApexSQL, SQL Cruise, Pluralsight