5 amazing reasons dbas need to love extended events

41
5 Amazing Reasons DBAs Need to Love Extended Events

Upload: jason-strate

Post on 24-May-2015

942 views

Category:

Technology


1 download

DESCRIPTION

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.

TRANSCRIPT

Page 1: 5 Amazing Reasons DBAs Need to Love Extended Events

5 Amazing Reasons DBAs Need to Love Extended Events

Page 2: 5 Amazing Reasons DBAs Need to Love Extended Events

Jason Strate

e: [email protected]

e: [email protected]

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

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

Extended Events

Page 5: 5 Amazing Reasons DBAs Need to Love Extended Events

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

Amazing!

Page 7: 5 Amazing Reasons DBAs Need to Love Extended Events
Page 8: 5 Amazing Reasons DBAs Need to Love Extended Events

Love!

Page 9: 5 Amazing Reasons DBAs Need to Love Extended Events

5 Amazing Reasons DBAs Need to Love Extended Events

Page 10: 5 Amazing Reasons DBAs Need to Love Extended Events

Data Survivability

Page 11: 5 Amazing Reasons DBAs Need to Love Extended Events

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

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

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

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

DATA SURVIVABILITY

Demo

Page 15: 5 Amazing Reasons DBAs Need to Love Extended Events

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

Get What You Want

Page 17: 5 Amazing Reasons DBAs Need to Love Extended Events

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

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

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

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

GET WHAT YOU WANT

Demo

Page 21: 5 Amazing Reasons DBAs Need to Love Extended Events

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

DMV Integration

Page 23: 5 Amazing Reasons DBAs Need to Love Extended Events

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

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

DMV INTEGRATION

Demo

Page 25: 5 Amazing Reasons DBAs Need to Love Extended Events

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

Wait Stat Tracing

Page 27: 5 Amazing Reasons DBAs Need to Love Extended Events

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Waits & Queues Methodology

Page 28: 5 Amazing Reasons DBAs Need to Love Extended Events

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

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

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

WAIT STAT TRACING

Demo

Page 31: 5 Amazing Reasons DBAs Need to Love Extended Events

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

Latch Tracing

Page 33: 5 Amazing Reasons DBAs Need to Love Extended Events

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

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

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

LATCH TRACING

Demo

Page 36: 5 Amazing Reasons DBAs Need to Love Extended Events

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

5 Amazing Reasons DBAs Need to Love Extended Events

Page 38: 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

Page 39: 5 Amazing Reasons DBAs Need to Love Extended Events
Page 40: 5 Amazing Reasons DBAs Need to Love Extended Events

Learn More About Extended Events

MAKING BUSINESS INTELLIGENT www.pragmaticworks.com

Page 41: 5 Amazing Reasons DBAs Need to Love Extended Events

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