5 Amazing Reasons DBAs
Need to Love Extended Events
Jason
Strate
e: jstrate@pragmaticworks.com
e: jasonstrate@gmail.com
b: www.jasonstrate.com
t: StrateSQL
Resources jasonstr...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
• Founded 2008 by MSFT MVP Brian Knight
• Focused on the MSFT SQL Serve...
Extended Events
Extended Events
Dynamic, highly configurable tracing
tool that provides access to events and
related information from the ...
Amazing!
Love!
5 Amazing Reasons DBAs
Need to Love Extended Events
Data Survivability
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Data Survivability
Scenario
• Weekend performance
issues expected
• Con...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Data Survivability
Scenario
• Performance issue shows
up
• Start Profil...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Data Survivability
• Solution exists with SQL Trace/Profiler
– Configur...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
DATA SURVIVABILITY
Demo
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Key Points on Data Survivability
• Extended events are highly configura...
Get What You Want
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Get What You Want
Mo’ Problems
• Performance issue shows
up
• Start Pro...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Get What You Want
Mo’ Problems
• Textdata returns
parameterized T-SQL
•...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Get What You Want
Mo’ Solutions
• Actions
– Plan_handle
– Query_handle
...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
GET WHAT YOU WANT
Demo
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Key Points on Get What You Want
• Extended events are highly configurab...
DMV Integration
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
DMV Integration
DMV Information
• Summary information
• Deeper informat...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
DMV INTEGRATION
Demo
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Key Points on DMV Integration
• DMVs allow expansion of trace results
–...
Wait Stat Tracing
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Waits & Queues Methodology
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Wait Stat Tracing
DMVs
• Sys.dm_os_wait_stats
• Sys.dm_os_waiting_tasks...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Wait Stat Tracing
Scenario
• Instance has been online for
months.
• Cod...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
WAIT STAT TRACING
Demo
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Key Points on Wait Stat Tracing
• Waits & Queues is a popular methodolo...
Latch Tracing
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Latch Tracing
Latch: Lightweight
synchronization activity.
Examples:
• ...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Latch Tracing
Scenario
• New application deployed
• High volume of user...
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
LATCH TRACING
Demo
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Key Points on Latch Tracing
• Latch issues can be hard to troubleshoot
...
5 Amazing Reasons DBAs
Need to Love Extended Events
Loving Extended Events
Data Survivability
Get What You Want
DMV Integration
Wait Stat Tracing
Latch Tracing
Learn More About Extended Events
MAKING BUSINESS INTELLIGENT
www.pragmaticworks.com
Services
Speed development through training, and
rapid development services from
Pragmatic Works.
Products
BI products to ...
5 Amazing Reasons DBAs Need to Love Extended Events
5 Amazing Reasons DBAs Need to Love Extended Events
Upcoming SlideShare
Loading in …5
×

5 Amazing Reasons DBAs Need to Love Extended Events

1,369 views

Published on

Extended events provide DBAs with a powerful tool that can be used to troubleshoot and investigate SQL Server. Throughout this session, you’ll walk through five great reasons, with demos. By the end of the webcast, you’ll be itching to grab the scripts from the demos to start building your own extended event sessions today.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

5 Amazing Reasons DBAs Need to Love Extended Events

  1. 1. 5 Amazing Reasons DBAs Need to Love Extended Events
  2. 2. Jason Strate e: jstrate@pragmaticworks.com e: jasonstrate@gmail.com b: www.jasonstrate.com t: StrateSQL Resources jasonstrate.com/go/xevents Introduction MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
  3. 3. 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 BI o Data Management o SQL Performance • Team led by multiple MVP’s • Offices throughout the US with Corporate HQ in Jacksonville, FL Pragmatic Works Company History
  4. 4. Extended Events
  5. 5. Extended Events Dynamic, highly configurable tracing tool that provides access to events and related information from the event.
  6. 6. Amazing!
  7. 7. Love!
  8. 8. 5 Amazing Reasons DBAs Need to Love Extended Events
  9. 9. Data Survivability
  10. 10. 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!
  11. 11. 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!
  12. 12. 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
  13. 13. MAKING BUSINESS INTELLIGENT www.pragmaticworks.com DATA SURVIVABILITY Demo
  14. 14. 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
  15. 15. Get What You Want
  16. 16. 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!
  17. 17. 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
  18. 18. 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
  19. 19. MAKING BUSINESS INTELLIGENT www.pragmaticworks.com GET WHAT YOU WANT Demo
  20. 20. 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
  21. 21. DMV Integration
  22. 22. MAKING BUSINESS INTELLIGENT www.pragmaticworks.com DMV Integration DMV Information • Summary information • Deeper information DMV Columns • Plan_handle • Query_handle • Query_hash • TSQL_stack
  23. 23. MAKING BUSINESS INTELLIGENT www.pragmaticworks.com DMV INTEGRATION Demo
  24. 24. 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
  25. 25. Wait Stat Tracing
  26. 26. MAKING BUSINESS INTELLIGENT www.pragmaticworks.com Waits & Queues Methodology
  27. 27. 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
  28. 28. 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
  29. 29. MAKING BUSINESS INTELLIGENT www.pragmaticworks.com WAIT STAT TRACING Demo
  30. 30. 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
  31. 31. Latch Tracing
  32. 32. 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
  33. 33. 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!
  34. 34. MAKING BUSINESS INTELLIGENT www.pragmaticworks.com LATCH TRACING Demo
  35. 35. 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
  36. 36. 5 Amazing Reasons DBAs Need to Love Extended Events
  37. 37. Loving Extended Events Data Survivability Get What You Want DMV Integration Wait Stat Tracing Latch Tracing
  38. 38. Learn More About Extended Events MAKING BUSINESS INTELLIGENT www.pragmaticworks.com
  39. 39. Services Speed development through training, and rapid development services from Pragmatic Works. Products BI products to covert to a Microsoft BI platform and simplify development on the platform. Foundation Helping those who do not have the means to get into information technology achieve their dreams. For more information… Name: Jason Strate Email: jstrate@pragmaticworks.com Blog: www.jasonstrate.com Resource: jasonstrate.com/go/xevents

×