Top Banner
SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410
29

SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Dec 18, 2015

Download

Documents

Andrea Stokes
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

SQL Power Tools - Enhance Your Effectiveness with Extended EventsboB ‘The Tool Man’ TaylorMCA, MCM, MCSD.Net, MCTMicrosoft Corporation

DBI410

Page 2: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

[email protected]

Blogs.msdn.com/bobtaylor

@SQL_MCA_MCSM

boB ‘The Tool Man’ Taylor

Tweeting? Use #TechEd and #DBI410 hash tags

Page 3: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Why are you here today?

A. I am a SQL Server DBAB. I am a SQL Server DeveloperC. I am an application developerD. The title just sounded coolE. All the above

Page 4: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Which tools do you use on a regular basis?A. SQL Server TraceB. SQL Server ProfilerC. SQLDiagD. RML UtilitiesE. SQL NexusF. All of the above

What do they have in common?

They all use SQL Server Trace

Page 5: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

They’ve taken away your tools!

SQL ProfilerSQL TraceSQL DiagRML UtilitiesSQL Nexus

Now what do you do?

Page 6: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Don’t Despair

Good News – New tools are available!Well… not totally newComplete engine coverageFull Tool Support

Bad News – There is a learning curveNot as steep as it used to be

Good News – You will learn these new tools today!

Page 7: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Extended Events Refresher

Real-time data captureNo performance penaltyBased on Event Tracing for Windows (ETW)Full programmability support

Page 8: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Extended Events Object Model

PackagesEvents and ActionsFilters and PredicatesSessionsTargets

Module

Package(s)Events

TargetsActions

Types

Predicates

Maps

Channels

Page 9: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Packages in SQL Server 2012

Name Description

package0 Default package. Contains all standard types, maps, compare operators, actions and targets

sqlos Extended events for SQL Operating System

XeDkPkg Extended events for SQLDK binary (SQLDK.dll now loads package0 and sqlos)

sqlserver Extended events for Microsoft SQL Server

SecAudit Security Audit Events

ucs Extended events for Unified Communications Stack

sqlclr Extended events for SQL CLR

filestream Extended events for SQL Server FILESTREAM and FileTable

sqlserver Extended events for Microsoft SQL Server

Page 10: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

System Sessions

system_healthAlwaysOn_health

Page 11: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

What does that give me?

Errors reportedNon-yielding schedulersDeadlocksInternal and external wait infosp_server_diagnostics outputPersisted to file or in memory

Page 12: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Viewing a real-time snapshot of system_health

SELECT CAST(xet.target_data as xml) FROM sys.dm_xe_session_targets xetJOIN sys.dm_xe_sessions xe

ON (xe.address = xet.event_session_address)

WHERE xe.name = 'system_health'

Page 13: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

demo

boB ‘The Tool Man’ TaylorMCA, MCM, MCSD.Net, MCTMicrosoft Corporation

Extended Events Profiler

Page 14: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

What other things can you look at?

sqlserver packagePage splits – see Jonathan Kehayias blogauto_statsbegin / end transaction Over 500 different items!

sqlos packagewait_infowait_info_externalspinlock_backoffsSixty different items

Page 15: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

But what about your other tools?

RML Utilities created by SQL Server escalation engineersThose same engineers drove the UI in Management StudioThe Top 10 by CPU or Duration are there out of the box!

Page 16: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

demo

boB ‘The Tool Man’ TaylorMCA, MCM, MCSD.Net, MCTMicrosoft Corporation

RML Type Reporting

Page 17: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

What about all my Profiler traces definitions?

Almost every Event and column available can be converted into Extended Event equivalents

1. Create a new session2. Look up every trace event and column and convert to events and actions – add to your new session3. Determine if any filters that exists and add those as predicates4. Add target(s)

Page 18: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

CREATE EVENT SESSION [SampledQueries] ON SERVER ADD EVENT sqlserver.error_reported( ACTION(sqlserver.client_app_name,sqlserver.database_id,sqlserver.query_hash,sqlserver.session_id) WHERE ((([package0].[divides_by_uint64]([sqlserver].[session_id],(5))) AND ([package0].[greater_than_uint64]([sqlserver].[database_id],(4)))) AND ([package0].[equal_boolean]([sqlserver].[is_system],(0))))),

ADD EVENT sqlserver.sql_batch_completed(ACTION(sqlserver.client_app_name,sqlserver.database_id,sqlserver.query_hash,sqlserver.session_id) WHERE ((([package0].[divides_by_uint64]([sqlserver].[session_id],(5))) AND ([package0].[greater_than_uint64]([sqlserver].[database_id],(4)))) AND ([package0].[equal_boolean]([sqlserver].[is_system],(0))))) ADD TARGET package0.ring_bufferWITH (MAX_MEMORY=4096 KB,EVENT_RETENTION_MODE=ALLOW_SINGLE_EVENT_LOSS, MAX_DISPATCH_LATENCY=30 SECONDS,MAX_EVENT_SIZE=0 KB, MEMORY_PARTITION_MODE=NONE,TRACK_CAUSALITY=ON,STARTUP_STATE=OFF)GO

Page 19: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Am I serious?

That is a lot of workIt is if you attempt to do this manually

What we need is a tool!boB ‘The Tool Man’ Taylor is happy to announce…

Page 20: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

announcing

http://SQLPie.CodePlex.com

SQLPIE on CodePlex

Page 21: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

demo

boB ‘The Tool Man’ TaylorMCA, MCM, MCSD.Net, MCTMicrosoft Corporation

Profiler Into Events (PIE)

Page 22: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Conclusion

They have taken away your old tools!You don’t care!The new tools are better anyway!

Call to actionStart using Extended Events today!

Page 23: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Time for Questions!

Page 25: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Resources

Connect. Share. Discuss.

http://northamerica.msteched.com

Learning

Microsoft Certification & Training Resources

www.microsoft.com/learning

TechNet

Resources for IT Professionals

http://microsoft.com/technet

Resources for Developers

http://microsoft.com/msdn

Page 26: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

Complete an evaluation on CommNet and enter to win!

Page 27: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

MS Tag

Scan the Tagto evaluate thissession now onmyTechEd Mobile

Page 28: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to

be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS

PRESENTATION.

Page 29: SQL Power Tools - Enhance Your Effectiveness with Extended Events boB ‘The Tool Man’ Taylor MCA, MCM, MCSD.Net, MCT Microsoft Corporation DBI410.