5 Amazing Reasons DBAs Need to Love Extended Events
-
Upload
jason-strate -
Category
Technology
-
view
942 -
download
1
description
Transcript of 5 Amazing Reasons DBAs Need to Love Extended Events
![Page 1: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/1.jpg)
5 Amazing Reasons DBAs Need to Love Extended Events
![Page 2: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/2.jpg)
Jason Strate
b: www.jasonstrate.com
t: StrateSQL
Resources jasonstrate.com/go/xevents
Introduction
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
![Page 3: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/3.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
• Founded 2008 by MSFT MVP Brian Knight• Focused on the MSFT SQL Server Platform• Provides services, training and software• MSFT/HP “go to” partner: • Gold Certified:
o BIo Data Managemento SQL Performance
• Team led by multiple MVP’s• Offices throughout the US with Corporate
HQ in Jacksonville, FL
Pragmatic Works Company History
![Page 4: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/4.jpg)
Extended Events
![Page 5: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/5.jpg)
Extended Events
Dynamic, highly configurable tracing tool that provides access to events and
related information from the event.
![Page 6: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/6.jpg)
Amazing!
![Page 7: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/7.jpg)
![Page 8: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/8.jpg)
Love!
![Page 9: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/9.jpg)
5 Amazing Reasons DBAs Need to Love Extended Events
![Page 10: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/10.jpg)
Data Survivability
![Page 11: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/11.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Data Survivability
Scenario• Weekend performance
issues expected• Configure SQL Trace to
capture statistics• You enjoy your weekend• Sysadmin/junior DBA
restarts instance on Friday night
• Monday morning… GO!
![Page 12: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/12.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Data Survivability
Scenario• Performance issue shows
up• Start Profiler to collect
some events• Initial analysis deems
– New events are needed– New columns are needed
• Collected data is still important
• Change the trace… GO!
![Page 13: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/13.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Data Survivability
• Solution exists with SQL Trace/Profiler
– Configure startup stored procedures
– Save off data
• Extended events
– Keep the session, restart on SQL Server startup
– Add events and columns on the fly
– Existing target unaffected
![Page 14: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/14.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
DATA SURVIVABILITY
Demo
![Page 15: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/15.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Key Points on Data Survivability
• Extended events are highly configurable
• Active sessions
– Events can be added/removed
– Columns can be added/removed
• Sessions
– Retained on startup
– Can automatically restart
![Page 16: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/16.jpg)
Get What You Want
![Page 17: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/17.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Get What You Want
Mo’ Problems• Performance issue shows
up• Start Profiler to collect
some events• Initial analysis deems
– New events are needed– New columns are needed
• Collected data is still important
• Change the trace… GO!
![Page 18: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/18.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Get What You Want
Mo’ Problems
• Textdata returns parameterized T-SQL
• Do you need BigintData1 and BigintData2?
• Aggregate data for trends
![Page 19: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/19.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Get What You Want
Mo’ Solutions• Actions
– Plan_handle– Query_handle– Query_hash– TSQL_stack– Is_system
• Targets– Histogram/Bucketizer– Event_coutner– Event_stream
![Page 20: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/20.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
GET WHAT YOU WANT
Demo
![Page 21: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/21.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Key Points on Get What You Want
• Extended events are highly configurable
– STILL!!
• Actions
– Add in the columns that you need
– Create actionable traces
• Targets
– More options that are useful
![Page 22: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/22.jpg)
DMV Integration
![Page 23: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/23.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
DMV Integration
DMV Information
• Summary information
• Deeper information
DMV Columns
• Plan_handle
• Query_handle
• Query_hash
• TSQL_stack
![Page 24: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/24.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
DMV INTEGRATION
Demo
![Page 25: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/25.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Key Points on DMV Integration
• DMVs allow expansion of trace results
– More detail
– Link other items together
• Build the complete picture
– Analyze all at once
• No intermediate levels of aggregation
![Page 26: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/26.jpg)
Wait Stat Tracing
![Page 27: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/27.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Waits & Queues Methodology
![Page 28: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/28.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Wait Stat Tracing
DMVs
• Sys.dm_os_wait_stats
• Sys.dm_os_waiting_tasks
Problem
• High level
• Aggregate
• Point in time
![Page 29: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/29.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Wait Stat Tracing
Scenario• Instance has been online for
months.• Code change deployed
recently• CPU spiked from 40% to 100% • High SOS_SCHEDULER_YIELD
waits and counts– Death by a million cuts
• High CPU items in DMVs are overnight maintenance jobs
![Page 30: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/30.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
WAIT STAT TRACING
Demo
![Page 31: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/31.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Key Points on Wait Stat Tracing
• Waits & Queues is a popular methodology– Difficult to track waits to statement
• DBAs empowered in Waits & Queues– Truly perform root cause analysis
• Specific waits can be traced and captured– Instance
– Database
– Application
– User
![Page 32: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/32.jpg)
Latch Tracing
![Page 33: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/33.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Latch Tracing
Latch: Lightweight synchronization activity.
Examples: • Page allocations• Disk-to-memory transfers• In-memory transfers
DMV• Sys.dm_os_latch_stats
![Page 34: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/34.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Latch Tracing
Scenario• New application deployed• High volume of users• High number of LATCH_EX waits
– Non-buffer latching– Exclusive
• Other applications appear to be affected
• Application is much slower than in test
• Where’s the problem… GO!
![Page 35: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/35.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
LATCH TRACING
Demo
![Page 36: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/36.jpg)
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
Key Points on Latch Tracing
• Latch issues can be hard to troubleshoot
• Typically happening out of sight
• Latches can be traced and captured
– Instance
– Database
– Application
– User
![Page 37: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/37.jpg)
5 Amazing Reasons DBAs Need to Love Extended Events
![Page 38: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/38.jpg)
Loving Extended Events
Data Survivability
Get What You Want
DMV Integration
Wait Stat Tracing
Latch Tracing
![Page 39: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/39.jpg)
![Page 40: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/40.jpg)
Learn More About Extended Events
MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
![Page 41: 5 Amazing Reasons DBAs Need to Love Extended Events](https://reader035.fdocuments.in/reader035/viewer/2022081710/55617549d8b42aac268b4a56/html5/thumbnails/41.jpg)
ServicesSpeed development through training, and rapid development services from Pragmatic Works.
ProductsBI products to covert to a Microsoft BI platform and simplify development onthe platform.
FoundationHelping those who do not have themeans to get into information technologyachieve their dreams.
For more information…
Name: Jason Strate
Email: [email protected]
Blog: www.jasonstrate.com
Resource: jasonstrate.com/go/xevents