SlideShare a Scribd company logo
1 of 22
Extended Events
Not so tricky as you might think




Jonathan Allen
@fatherjack
sqlsouthwest.co.uk
Who on Earth is Jonathan Allen?
   Local Government 13 years – accountancy / tax collection.


   Systems engineer and DBA since 1999


   SQL Server 6.5, 7, 2000, 2005 and 2008+R2, 2012


   Blog, Twitter, SQL South West user group
What's coming up
• XE - architecture and components.
• What can Extended Events show us?
• Getting started.
• System Health Extended Events session.
• Working with XE.
   – T-SQL.
   – Extended Events manager SSMS Add-in.
   – SQL Server 2012 interface.
Extended Events don’t bite
(Image recreated by Jonathan Allen from MSDN/Books online)
(Image recreated by Jonathan Allen from MSDN/Books online)
(Image recreated by Jonathan Allen from MSDN/Books online)
(Image recreated by Jonathan Allen from MSDN/Books online)
(Image recreated by Jonathan Allen from MSDN/Books online)
(Image recreated by Jonathan Allen from MSDN/Books online)
(Image recreated by Jonathan Allen from MSDN/Books online)
(Image recreated by Jonathan Allen from MSDN/Books online)
(Image recreated by Jonathan Allen from MSDN/Books online)
What can Extended Events show us?
From BOL:
 Troubleshooting excessive CPU usage
 You are investigating excessive CPU usage on your production system. You use various Dynamic
 Management Views (DMVs) to determine if the CPU usage can be attributed to queries that were
 run on the system. This examination indicates that most of the queries are ad-hoc user queries.
 The information obtained from the DMVs is not enough to diagnose the problem.

 You create an Extended Events session that:
 • Enables events for statement completion with predicates that specify CPU threshold.
 • Has an action to only collect the query plan when the event fires.
 • Writes any data that is collected to a file. This file is on a drive that does not contain any log or
     database files.

 After starting the Extended Events session you examine the output and are able to determine that
 the cause of the CPU problem is a data type conversion between two commonly joined tables.




(http://msdn.microsoft.com/en-us/library/bb630354(SQL.100).aspx)
Working with Extended Events

Options

• SQL 2008, 2008 R2
  – TSQL
  – Extended Events Session Explorer


• SQL 2012
  – TSQL
  – SSMS (not effective on prev. versions)
Demos

• SSMS 2005/8/R2
  – Catching errors
  – Identifying slow queries


• 2012
  – Spotting deprecation issues
  – System health session
Demo
XE Best Practice / Recommendations

Consider
• Target – Sync or Async


• Storage – type, size


• Retention – No_Event_Loss or
  Allow_Single_Event_Loss/Allow_multiple_Event_Loss


• Use SSMS 2012 to build session, script it, apply to 2008
Reference
• Jonathan Kehayias
   –   http://twitter.com/#!/sqlpoolboy / http://www.sqlskills.com
   –   http://extendedeventmanager.codeplex.com/
   –   http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/12.aspx



• MVP Deep Dives 1
   –   Chapter 49 by Christian Lefter – via Amazon among other book sellers



• SQL Server 2008 Internals and Troubleshooting
   –   (Bolton, Langford, Ozar, Rowland-jones, Wort) via Amazon among other book sellers



• Adam Machanic – blog (code generator/tips+advice)
   –   http://sqlblog.com/blogs/adam_machanic/archive/tags/extended+events/default.aspx
Reference
• SQL 2012 SSRS performance reports
   –   http://www.microsoft.com/download/en/details.aspx?id=29063



• Books Online
   – 2008 - http://msdn.microsoft.com/en-us/library/bb677357(v=SQL.100).aspx
   – 2012 - http://msdn.microsoft.com/en-us/library/ms130214(v=sql.110).aspx

• MSDN Convert Trace to XE article
   –   http://msdn.microsoft.com/en-us/library/ff878114(v=sql.110).aspx

• MSDN Blog – Grant Fritchey
   –   http://blogs.msdn.com/b/microsoft_press/archive/2012/03/21/from-the-mvps-a-gui-for-extended-
       events-in-sql-server-2012.aspx
Contact me
•   Blog – http://www.simple-talk.com/community/blogs/jonathanallen

•   SQL forum moderator – http://ask.sqlservercentral.com

•   Twitter - @Fatherjack

•   SQLSouthWest User Group leader – jonathan@sqlsouthwest.co.uk

•   PASS UK Regional Mentor – http://sqlpass.org / ukrm@sqlpass.org

•   Friend of Red Gate - http://www.red-gate.com




                                Jonathan Allen © - May 2011

More Related Content

What's hot

Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Antonios Chatzipavlis
 
Implementing sql server always on
Implementing sql server always onImplementing sql server always on
Implementing sql server always onSarabpreet Anand
 
SQL Injection Attacks: Is Your Data Secure? .NET Edition
SQL Injection Attacks: Is Your Data Secure? .NET EditionSQL Injection Attacks: Is Your Data Secure? .NET Edition
SQL Injection Attacks: Is Your Data Secure? .NET EditionBert Wagner
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyAntonios Chatzipavlis
 
What Is SQL?
What Is SQL?What Is SQL?
What Is SQL?QATestLab
 
System health session
System health sessionSystem health session
System health sessionAmit Banerjee
 
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 EditionSQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 EditionMark Broadbent
 
What I Learned About SQL Server at Ignite 2015
What I Learned About SQL Server at Ignite 2015What I Learned About SQL Server at Ignite 2015
What I Learned About SQL Server at Ignite 2015Brent Ozar
 
Web testing with selenium and by quontra solutions
Web testing with selenium and  by quontra solutionsWeb testing with selenium and  by quontra solutions
Web testing with selenium and by quontra solutionsQUONTRASOLUTIONS
 
Tips to install and manage always on availability groups in sql server 2012 &...
Tips to install and manage always on availability groups in sql server 2012 &...Tips to install and manage always on availability groups in sql server 2012 &...
Tips to install and manage always on availability groups in sql server 2012 &...Antonios Chatzipavlis
 
Sql server 2012 AlwaysOn
Sql server 2012 AlwaysOnSql server 2012 AlwaysOn
Sql server 2012 AlwaysOnWarwick Rudd
 
Evaluate Daily Checklist with PBM and CMS
Evaluate Daily Checklist with PBM and CMSEvaluate Daily Checklist with PBM and CMS
Evaluate Daily Checklist with PBM and CMSJohn Sterrett
 
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedRoman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedMSDEVMTL
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringIDERA Software
 
Sql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffySql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffyAnuradha
 
Always on in SQL Server 2012
Always on in SQL Server 2012Always on in SQL Server 2012
Always on in SQL Server 2012Fadi Abdulwahab
 
SQL Server ASYNC_NETWORK_IO Wait Type Explained
SQL Server ASYNC_NETWORK_IO Wait Type ExplainedSQL Server ASYNC_NETWORK_IO Wait Type Explained
SQL Server ASYNC_NETWORK_IO Wait Type ExplainedConfio Software
 
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerMarek Maśko
 
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability GroupsSQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groupsturgaysahtiyan
 

What's hot (20)

Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014Configuring sql server - SQL Saturday, Athens Oct 2014
Configuring sql server - SQL Saturday, Athens Oct 2014
 
Implementing sql server always on
Implementing sql server always onImplementing sql server always on
Implementing sql server always on
 
SQL Injection Attacks: Is Your Data Secure? .NET Edition
SQL Injection Attacks: Is Your Data Secure? .NET EditionSQL Injection Attacks: Is Your Data Secure? .NET Edition
SQL Injection Attacks: Is Your Data Secure? .NET Edition
 
Pre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctlyPre and post tips to installing sql server correctly
Pre and post tips to installing sql server correctly
 
What Is SQL?
What Is SQL?What Is SQL?
What Is SQL?
 
System health session
System health sessionSystem health session
System health session
 
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 EditionSQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
SQL Server AlwaysOn for Dummies SQLSaturday #202 Edition
 
What I Learned About SQL Server at Ignite 2015
What I Learned About SQL Server at Ignite 2015What I Learned About SQL Server at Ignite 2015
What I Learned About SQL Server at Ignite 2015
 
Web testing with selenium and by quontra solutions
Web testing with selenium and  by quontra solutionsWeb testing with selenium and  by quontra solutions
Web testing with selenium and by quontra solutions
 
DBA Trainer RESUME
DBA Trainer RESUMEDBA Trainer RESUME
DBA Trainer RESUME
 
Tips to install and manage always on availability groups in sql server 2012 &...
Tips to install and manage always on availability groups in sql server 2012 &...Tips to install and manage always on availability groups in sql server 2012 &...
Tips to install and manage always on availability groups in sql server 2012 &...
 
Sql server 2012 AlwaysOn
Sql server 2012 AlwaysOnSql server 2012 AlwaysOn
Sql server 2012 AlwaysOn
 
Evaluate Daily Checklist with PBM and CMS
Evaluate Daily Checklist with PBM and CMSEvaluate Daily Checklist with PBM and CMS
Evaluate Daily Checklist with PBM and CMS
 
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail UnleashedRoman Rehak: 24/7 Database Administration + Database Mail Unleashed
Roman Rehak: 24/7 Database Administration + Database Mail Unleashed
 
Geek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database MirroringGeek Sync | Field Medic’s Guide to Database Mirroring
Geek Sync | Field Medic’s Guide to Database Mirroring
 
Sql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffySql server 2012 - always on deep dive - bob duffy
Sql server 2012 - always on deep dive - bob duffy
 
Always on in SQL Server 2012
Always on in SQL Server 2012Always on in SQL Server 2012
Always on in SQL Server 2012
 
SQL Server ASYNC_NETWORK_IO Wait Type Explained
SQL Server ASYNC_NETWORK_IO Wait Type ExplainedSQL Server ASYNC_NETWORK_IO Wait Type Explained
SQL Server ASYNC_NETWORK_IO Wait Type Explained
 
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft EngineerPLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
PLSSUG - Troubleshoot SQL Server performance problems like a Microsoft Engineer
 
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability GroupsSQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
SQLSaturday Bulgaria : HA & DR with SQL Server AlwaysOn Availability Groups
 

Similar to Extended Events Made Simple: An Intro to XE Sessions in SQL Server

SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availabilityPeter Gfader
 
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 serverAntonios Chatzipavlis
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabaseTung Nguyen Thanh
 
new resume of Database Administrator
new resume of Database Administratornew resume of Database Administrator
new resume of Database AdministratorGetahun Gebremariam
 
SQL Server and System Center Advisor
SQL Server and System Center AdvisorSQL Server and System Center Advisor
SQL Server and System Center AdvisorEduardo Castro
 
Geek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVPGeek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVPIDERA Software
 
Mohammed Arif_RESUME
Mohammed Arif_RESUMEMohammed Arif_RESUME
Mohammed Arif_RESUMEMohammed Arif
 
Blackbook microsoft sql server
Blackbook microsoft sql serverBlackbook microsoft sql server
Blackbook microsoft sql serverSachin Savanur
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAConcentrated Technology
 
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptxSQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptxEddie Gonzalez
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance TuningBala Subra
 
Sql server 2012 autoexec event no 39
Sql server 2012 autoexec event no 39Sql server 2012 autoexec event no 39
Sql server 2012 autoexec event no 39Antonios Chatzipavlis
 
Top 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersTop 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersIke Ellis
 
SQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and ApproachSQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and ApproachIndra Dharmawan
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersShehap Elnagar
 

Similar to Extended Events Made Simple: An Intro to XE Sessions in SQL Server (20)

SQL Server - High availability
SQL Server - High availabilitySQL Server - High availability
SQL Server - High availability
 
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
 
SharePoint Performance
SharePoint PerformanceSharePoint Performance
SharePoint Performance
 
Managing SQLserver
Managing SQLserverManaging SQLserver
Managing SQLserver
 
Breaking data
Breaking dataBreaking data
Breaking data
 
Performance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL DatabasePerformance Tuning And Optimization Microsoft SQL Database
Performance Tuning And Optimization Microsoft SQL Database
 
new resume of Database Administrator
new resume of Database Administratornew resume of Database Administrator
new resume of Database Administrator
 
SQL_DBA USA_M&T Bank
SQL_DBA USA_M&T BankSQL_DBA USA_M&T Bank
SQL_DBA USA_M&T Bank
 
SQL Server and System Center Advisor
SQL Server and System Center AdvisorSQL Server and System Center Advisor
SQL Server and System Center Advisor
 
Geek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVPGeek Sync | Performance Tune Like an MVP
Geek Sync | Performance Tune Like an MVP
 
Mohammed Arif_RESUME
Mohammed Arif_RESUMEMohammed Arif_RESUME
Mohammed Arif_RESUME
 
Blackbook microsoft sql server
Blackbook microsoft sql serverBlackbook microsoft sql server
Blackbook microsoft sql server
 
Managing SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBAManaging SQLserver for the reluctant DBA
Managing SQLserver for the reluctant DBA
 
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptxSQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
SQLUpgrade_What_do_I_need_to_know_-_SQLSaturday_Manchester.pptx
 
Sql Server Performance Tuning
Sql Server Performance TuningSql Server Performance Tuning
Sql Server Performance Tuning
 
Sql server 2012 autoexec event no 39
Sql server 2012 autoexec event no 39Sql server 2012 autoexec event no 39
Sql server 2012 autoexec event no 39
 
Top 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developersTop 5 things to know about sql azure for developers
Top 5 things to know about sql azure for developers
 
PowerPivot for DBAs
PowerPivot for DBAsPowerPivot for DBAs
PowerPivot for DBAs
 
SQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and ApproachSQL Server Upgrade and Consolidation - Methodology and Approach
SQL Server Upgrade and Consolidation - Methodology and Approach
 
T sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powersT sql performance guidelines for better db stress powers
T sql performance guidelines for better db stress powers
 

Recently uploaded

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piececharlottematthew16
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 

Recently uploaded (20)

"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Story boards and shot lists for my a level piece
Story boards and shot lists for my a level pieceStory boards and shot lists for my a level piece
Story boards and shot lists for my a level piece
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 

Extended Events Made Simple: An Intro to XE Sessions in SQL Server

  • 1. Extended Events Not so tricky as you might think Jonathan Allen @fatherjack sqlsouthwest.co.uk
  • 2. Who on Earth is Jonathan Allen?  Local Government 13 years – accountancy / tax collection.  Systems engineer and DBA since 1999  SQL Server 6.5, 7, 2000, 2005 and 2008+R2, 2012  Blog, Twitter, SQL South West user group
  • 3. What's coming up • XE - architecture and components. • What can Extended Events show us? • Getting started. • System Health Extended Events session. • Working with XE. – T-SQL. – Extended Events manager SSMS Add-in. – SQL Server 2012 interface.
  • 5. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 6. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 7. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 8. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 9. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 10. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 11. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 12. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 13. (Image recreated by Jonathan Allen from MSDN/Books online)
  • 14. What can Extended Events show us? From BOL: Troubleshooting excessive CPU usage You are investigating excessive CPU usage on your production system. You use various Dynamic Management Views (DMVs) to determine if the CPU usage can be attributed to queries that were run on the system. This examination indicates that most of the queries are ad-hoc user queries. The information obtained from the DMVs is not enough to diagnose the problem. You create an Extended Events session that: • Enables events for statement completion with predicates that specify CPU threshold. • Has an action to only collect the query plan when the event fires. • Writes any data that is collected to a file. This file is on a drive that does not contain any log or database files. After starting the Extended Events session you examine the output and are able to determine that the cause of the CPU problem is a data type conversion between two commonly joined tables. (http://msdn.microsoft.com/en-us/library/bb630354(SQL.100).aspx)
  • 15. Working with Extended Events Options • SQL 2008, 2008 R2 – TSQL – Extended Events Session Explorer • SQL 2012 – TSQL – SSMS (not effective on prev. versions)
  • 16. Demos • SSMS 2005/8/R2 – Catching errors – Identifying slow queries • 2012 – Spotting deprecation issues – System health session
  • 17. Demo
  • 18. XE Best Practice / Recommendations Consider • Target – Sync or Async • Storage – type, size • Retention – No_Event_Loss or Allow_Single_Event_Loss/Allow_multiple_Event_Loss • Use SSMS 2012 to build session, script it, apply to 2008
  • 19. Reference • Jonathan Kehayias – http://twitter.com/#!/sqlpoolboy / http://www.sqlskills.com – http://extendedeventmanager.codeplex.com/ – http://sqlblog.com/blogs/jonathan_kehayias/archive/2010/12.aspx • MVP Deep Dives 1 – Chapter 49 by Christian Lefter – via Amazon among other book sellers • SQL Server 2008 Internals and Troubleshooting – (Bolton, Langford, Ozar, Rowland-jones, Wort) via Amazon among other book sellers • Adam Machanic – blog (code generator/tips+advice) – http://sqlblog.com/blogs/adam_machanic/archive/tags/extended+events/default.aspx
  • 20. Reference • SQL 2012 SSRS performance reports – http://www.microsoft.com/download/en/details.aspx?id=29063 • Books Online – 2008 - http://msdn.microsoft.com/en-us/library/bb677357(v=SQL.100).aspx – 2012 - http://msdn.microsoft.com/en-us/library/ms130214(v=sql.110).aspx • MSDN Convert Trace to XE article – http://msdn.microsoft.com/en-us/library/ff878114(v=sql.110).aspx • MSDN Blog – Grant Fritchey – http://blogs.msdn.com/b/microsoft_press/archive/2012/03/21/from-the-mvps-a-gui-for-extended- events-in-sql-server-2012.aspx
  • 21.
  • 22. Contact me • Blog – http://www.simple-talk.com/community/blogs/jonathanallen • SQL forum moderator – http://ask.sqlservercentral.com • Twitter - @Fatherjack • SQLSouthWest User Group leader – jonathan@sqlsouthwest.co.uk • PASS UK Regional Mentor – http://sqlpass.org / ukrm@sqlpass.org • Friend of Red Gate - http://www.red-gate.com Jonathan Allen © - May 2011

Editor's Notes

  1. Career historySQL historyCommunity content
  2. How many people are moving to SQL 2012 right away?Count using versions – 2000 ?!, 2005, 2008+R2Does any have experience of writing code – C, VB, etc ?Taking you from what Extended Events are and how they fit in with SQL Server, through using the default session to keep an eye on your servers to creating your own Event Sessions to check for important events and potential problems.
  3. How many people are moving to SQL 2012 right away?Count using versions – 2000 ?!, 2005, 2008+R2Does any have experience of writing code – C, VB, etc ?Taking you from what Extended Events are and how they fit in with SQL Server, through using the default session to keep an eye on your servers to creating your own Event Sessions to check for important events and potential problems.
  4. Lightweight event handling platform, specifically designed to be used to trouble shoot performance issue and monitoring system performancePreviously to SQL 2005 SQL Trace has been used but always had the overhead, or at least the concern of it, and the risk of masking the issue or making it worse. You could use “server side traces” rather than the SQL Profiler tool but it was still a measurable drag on the system it was monitoring.
  5. Packages are the containers, or groups, for events. There are four packages registered to the Extended Events engine, although one of those is essentially inaccessible to the DBA, and they contain between them all Extended Events objects.
  6. Events – these are known points in code that are of interest. They are categorised in such a way as to align with ETW categories. Channels (interested party – Admin, analytic, Debug + Operational) and keywordsActions – these extend the event in various ways, collecting extra data, aggregating data, getting a stack dump storing state information and even adding a debug breakpoint. Be careful using that one. SQL Server stops!Types –The type is the format of the event data, int32, unicode_stringetcMaps – the way to decode the internal values to an english descriptionTargets – where the collected information is sent. Some targets are only usable with sync or async collection, some can work with both.Predicates – effectively the where clause of the event data collection. Supporting short circuiting so as to allow for max efficiency in what data is collected. Evaluated to a boolean true/false
  7. A session is a collection of events (including the specified actions and predicates), the targets that have been configured and the details of the buffers where the collected data will be sent/stored
  8. Some buffers EG a Deadlock session may have the [sqlserver].[xml_deadlock_reported] event with the [Package0].[ring_buffer] set to a 2MB memory limitA StmtCompleted session might catch the [sqlserver].[sql_statement_completed] event and use the [Package0].[ring_buffer] with a Max_memory setting of 8MB
  9. The pool of threads which make up the mechanism throughwhich the session output it gathered and passed into the chosen targets.Details from sys.dm_os_dispatcher_pools
  10. The individual thread.
  11. Several common examples in Books Online but XE can do so much more.Detecting excessive CPU, Deadlocks, Page Splits, Plan Cache use / non-use the list goes on.
  12. Introduced in 2005 so if you manage 2000 then you still need to use Profiler/TraceNo GUI until Jonathan Kehayias created the XE Session Explorer SSMS addin – available via codeplex