Extended Events Hilary.cotter@gmail.com.

Slides:



Advertisements
Similar presentations
Yukon – What is New Rajesh Gala. Yukon – What is new.NET Framework Programming Data Types Exception Handling Batches Databases Database Engine Administration.
Advertisements

DAT 342 Advanced SQL Server Performance and Tuning Bren Newman Program Manager SQL Server Development Microsoft Corporation.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
SQL Server 2012 New Performance Tuning Tools. Who am I? Menzo Steinhorst Senior Premier Field Engineer SQLRAP, WS+ SQL Server Performance Tuning, WS+
SQLSaturday #251 – Paris 2013 SQL Trace vs Extended Events David Barbarin Database Architect
Module 12: Auditing SQL Server Environments
Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
SQL Server Extended Events What, Why, How, Who?. Stuart Moore Started with SQL Server 7 in 1998, 15 years later still working with it, but newer versions.
Troubleshooting Techniques Lesson 29. Skills Matrix.
Jeremy Boyd Director – Mindscape MSDN Regional Director
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Managing and Monitoring SQL Server 2005 Shankar Pal Program Manager SQL Server, Redmond.
René Balzano Technology Solution Professional Data Platform Microsoft Switzerland Database Development with SQL Server Data Tools (SSDT)
Passage Three Introduction to Microsoft SQL Server 2000.
Module 5: Data Access. Overview Introduce database components involved in data access Introduce concepts of Transact -SQL and Procedural SQL as tools.
Course Topics Administering SQL Server 2012 Jump Start 01 | Install and Configure SQL Server04 | Manage Data 02 | Maintain Instances and Databases05 |
Connect Learn Share Performance Optimization for Microsoft Dynamics CRM Presented by: Walter Grow Austin Jones.
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
Integrating and managing your Engaging Networks data Top ten data features.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
DBI Meets mission critical high availability SLA Integrated Efficient Flexible.
Performance Dash A free tool from Microsoft that provides some quick real time information about the status of your SQL Servers.
Learningcomputer.com SQL Server 2008 – Administration, Maintenance and Job Automation.
Siebel 8.0 Module 5: EIM Processing Integrating Siebel Applications.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
Chandrika Shankarnarayan Senior Program Manager Microsoft Corporation SESSION CODE: ASI301.
3 Copyright © 2004, Oracle. All rights reserved. Working in the Forms Developer Environment.
Under New Management Andrew Fryer Microsoft UK Andrew Fryer Microsoft UK.
Enterprise Database Administration & Deployment SIG ▪ 313M ▪ Sept 29, 2005 ▪ 10:15 AM SQL Server 2005 Performance Diagnosis and Tuning using SQL Tools.
SQL School is strongly committed to provide COMPLETE PRACTICAL REALTIME Trainings on SQL Server Technologies – Dev, SQL DBA, MSBI (SSIS, SSAS, SSRS) and.
Troubleshooting SQL Server Performance: Tips &Tools Amit Khandelwal.
Differences Training BAAN IVc-BaanERP 5.0c: Application Administration, Customization and Exchange BaanERP 5.0c Tools / Exchange.
The X-Factor of the Extended Events Amit Khandelwal.
EOH: A Microsoft Partner INTRODUCTION TO EXTENDED EVENTS.
SQL Query Analyzer. Graphical tool that allows you to:  Create queries and other SQL scripts and execute them against SQL Server databases. (Query window)
The best of WF 4.0 and AppFabric Damir Dobric MVP-Connected System Developer Microsoft Connected System Division Advisor Visual Studio Inner Circle member.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
SAP Tuning 실무 SK㈜ ERP TFT.
Improve query performance with the new SQL Server 2016 query store!! Michelle Gutzait Principal Consultant at
Database Development with SQL Server Data Tools (SSDT) Björn Eriksen, Architect Evangelist DPE Microsoft
Session Name Pelin ATICI SQL Premier Field Engineer.
Getting the Most from SQL Server 2005 Don Vilen Program Manager SQL Server Microsoft Corporation.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
SQL Saturday #509 | Brisbane 2016 #509 | Brisbane 2016 Martin Catherall Moving from Profiler to Extended Events.
SQL Database Management
Extend Your Knowledge with Extended Events!
What Is The SSIS Catalog and Why Do I Care?
Hilary Cotter Extended Events.
SQL Server Data Collector From Every Angle
Building a Performance Monitoring System using XEvents and DMVs
Building a Performance Monitoring System using XEvents and DMVs
SQL Server Monitoring Overview
Extend Your Knowledge with Extended Events!
Medlemsträff i Stockholm
Microsoft Dumps Question Answer - Dumps4download
Simplifying XEvents Management with dbatools
Download Microsoft Exam Dumps - Valid Microsoft Question Answers - Realexamdumps.com
Performance Monitoring Using Extended Events, DMVs & Query Store
Building a Performance Monitoring System using XEvents and DMVs
SQL 2014 In-Memory OLTP What, Why, and How
Wellington, SQLSaturday#706
Moving from SQL Profiler to xEvents
Andrew Fryer Microsoft UK
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Building a Performance Monitoring System using XEvents and DMVs
Using wait stats to determine why my server is slow
Extended Events: Successful troubleshooting recipes
Advanced Database Topics
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Presentation transcript:

Extended Events Hilary.cotter@gmail.com

Agenda What are Extended Events? How do they compare with Profiler Concepts Tutorial Use cases

What are Extended Events Real-time data capture No performance penalty Lightweight Lock:Aquired, Lock:Released with little performance degradation. Based on Event Tracing for Windows (ETW) Allows integration with OS operations, for example we can now trace if a file copy operation is degrading performance on SQL Server. Full programmability support TSQL SMO PowerShell

How do they compare with Profiler XE Designed to replace Profiler/SQL Trace XE Captures more value/properties/events than profiler XE is integrated with ETW and Management Studio Activity Monitor XE does not require a connection to SQL Server SQL Trace will be deprecated in SQL Next (still ships in SQL 2017) SQL 2008 – no nice interface for Extended Events Extended Events Manager - https://extendedeventmanager.codeplex.com/ SQL 2012 baked into Management Studio Allows you to obtain wait statistics on a query/proc/statement.

ETW

ETW Logman query providers c:\temp\out.txt Select * from sys.dm_xe_packages Package0 60AA9FBF-673B-4553-B7ED-71DCA7F5E972 Sqlos BD97CC63-3F38-4922-AA93-607BD12E78B2 XeDkPkg 52FC232C-03D5-4E1F-A6BF-BBC66FE20E6A sqlserver 655FD93F-3364-40D5-B2BA-330F7FFB6491 SecAudit F235752A-D5C0-4C9A-A735-9C3B6F6E43B1 ucs C0AB75C5-B1EA-445B-B7DF-F897686F94E7 sqlclr 1E99FE90-A4FE-45E6-9DFD-A45041F02314 filestream B086C2F3-2738-4389-B119-D80B5362B5CA sqlserver 03FDA7D0-91BA-45F8-9875-8B6DD0B8E9F2

Traces vs XE

Well what about the black box trace then? SQL 2012 adds default xe sessions (traces) AlwaysOn_Health System_health SQL 2014 adds Nothing SQL 2016 adds Telemetry_xevents Mainly for diagnostics – error collection

Ring buffer Getting ahead of ourselves but…

Extended Events Object Model Module Package(s) Events Targets Actions Types Predicates Maps Channels

XE - packages select * from sys.dm_xe_packages where coalesce(capabilities,1)=1 sqlos Extended events for SQL Operating System 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 qds Extended events for Query Store XtpRuntime Extended events for the XTP Runtime XtpCompile Extended events for the XTP Compile XtpEngine Extended events for the XTP Engine XTP (eXtreme Transaction Processing – Hekaton). sqlserver

Extended Events Object Model Module Package(s) Events Targets Actions Types Predicates Maps Channels Packages Events and Actions Filters and Predicates Sessions Targets

XE- Events Well known endpoints in SQL Server Code, ie sp_statement_completed, rpc_starting, rpc_completed. Events are categorized in ETW as Admin – error reports, deprecated events, blocks, deadlocks Analytical – this is of most interest to us. Debug – css primarily. Operational – managing admin events – attaching dbs, dropping dbs. Blocked Process Report.

Extended Events Object Model Module Package(s) Events Targets Actions Types Predicates Maps Channels Packages Events and Actions Filters and Predicates Sessions Targets

XE-Actions Capability to execute additional actions when the event fires within the engine. Think of these like the columns in Profiler

Extended Events Object Model Module Package(s) Events Targets Actions Types Predicates Maps Channels Packages Events and Actions Filters and Predicates Sessions Targets

XE-Predicates Allow you to filter on certain events. Source – and Compare

Extended Events Object Model Module Package(s) Events Targets Actions Types Predicates Maps Channels Packages Events and Actions Filters and Predicates Sessions Targets

XE-types and maps Select * from sys.dm_xe_objects where object_type in ('type','map') type scalar Map – list Select * from sys.dm_xe_objects where object_type in ('type','map') and name='wait_types' Select * from sys.dm_xe_map_values where name='wait_types'

Extended Events Object Model Module Package(s) Events Targets Actions Types Predicates Maps Channels Packages Events and Actions Filters and Predicates Sessions Targets

XE-Target Where data ends up etw_classic_sync_target-Event Tracing for Windows (ETW) Synchronous Target Histogram-Use the histogram target to aggregate event data based on a specific event data field or action associated with the event. The histogram allows you to analyze distribution of the event data over the period of the event session. event_file-Use the event_file target to save the event data to an XEL file, which can be archived and used for later analysis and review. You can merge multiple XEL files to view the combined data from separate event sessions. pair_matching-Pairing target event_counter-Use the event_counter target to count the number of occurrences of each event in the event session. ring_buffer-Asynchronous ring buffer target.

XE Templates – locks and blocks Count Query Locks Use this template to identify the most lock intensive queries for investigation and tuning.

XE Templates – Query Execution Query Batch Sampling Samples 20% (by default) of your batches and RPC statements in your workload and error information. Query Batch Tracking Collects all batch and RPC level statements as well as error information. Can be very large. Query Detail Sampling Samples 20% (by default) of your statements in your workload and error information. Collects the query hash and query plan hash for every statement it tracks. Query Detail Tracking Collects all detailed statement and error information. Can be used to determine which statement in a batch or procedure threw the error. Can be very large. Query Wait Statistics Tracks internal and external wait statistics for individual query statements, batches and RPCs. 20 % sample rate.

XE Templates - System Monitoring Activity Tracking Most similar to trace. Connection Monitoring Tracks connection activity for a server. Normal connection activity is tracked using the login and logout events, and problems are recorded using the connectivity_ring_buffer_recorded event. Database Log File IO Tracking Monitors the IO for database log files on a server by tracking asynchronous IO, database log flushes, file writes, spinlock backoffs of type LOGFLUSHQ and waits of type WRITELOG.

Top Resource Consumers High Performance.SQL Master database on publisher, table called called Perf

Timeouts Timeouts1.sql

Page Splits PageSplits.sql https://www.sqlskills.com/blogs/jonathan/tracking-problematic- pages-splits-in-sql-server-2012-extended-events-no-really-this-time/

Errors Errors.sql

Converting a profiler trace to XE From http://blogs.msdn.com/b/extended_events/archive/2010/12/10/mi grating-from-sql-trace-to-extended-events.aspx C:\ExtendedEvents\Converting my SQL Server Trace File to an Extended Event

Blocking

Debugging use master GO insert into dm_hadr_database_replica_states select recovery_lsn, truncation_lsn, last_hardened_lsn, last_received_lsn, log_send_queue_size,log_send_queue_size/log_send_rate[log_send_q ueue_size/log_send_rate],log_send_rate,redo_queue_size, last_redone_lsn, last_redone_time,database_id, getdate() dtstamp, db_name(database_id) databaseName from sys.dm_hadr_database_replica_states where log_send_rate>0