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.

Slides:



Advertisements
Similar presentations
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Advertisements

SQL Server 2012 New Performance Tuning Tools. Who am I? Menzo Steinhorst Senior Premier Field Engineer SQLRAP, WS+ SQL Server Performance Tuning, WS+
ADABAS to RDBMS UsingNatQuery. The following session will provide a high-level overview of NatQuerys ability to automatically extract ADABAS data from.
ACT! “Web” Plugins ACC Webinar (Part 1of 2) Brian Mowka and Jamie Aurand December 2010.
Managing Users. Overview for School Admin Users Define Users Users Module Add Users Importing Users and Groups Manually adding users Search for Users.
SQLSaturday #251 – Paris 2013 SQL Trace vs Extended Events David Barbarin Database Architect
Use the tools support uses.
Module 17 Tracing Access to SQL Server 2008 R2. Module Overview Capturing Activity using SQL Server Profiler Improving Performance with the Database Engine.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment Chapter 11: Monitoring Server Performance.
Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
Chapter 17: Watching Your System BAI617. Chapter Topics Working With Event Viewer Performance Monitor Resource Monitor.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
Course Topics Administering SQL Server 2012 Jump Start 01 | Install and Configure SQL Server04 | Manage Data 02 | Maintain Instances and Databases05 |
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
5 Copyright © 2008, Oracle. All rights reserved. Configuring the Oracle Network Environment.
Troubleshooting From the Field – Part 2 SQL DIAG & SQL NEXUS By Ahmad Osama SQL Server Geeks - Editor In Chief and Regional Mentor(Delhi & NCR)
How to solve a SQL performance problem Paul Zgondea.
Module 10: Monitoring ISA Server Overview Monitoring Overview Configuring Alerts Configuring Session Monitoring Configuring Logging Configuring.
Oracle 10g Database Administrator: Implementation and Administration Chapter 2 Tools and Architecture.
Learningcomputer.com SQL Server 2008 – Profiling and Monitoring Tools.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
ASP.NET State Management. Slide 2 Lecture Overview Client state management options Cookies Server state management options Application state Session state.
What’s new in Kentico CMS 5.0 Michal Neuwirth Product Manager Kentico Software.
70-290: MCSE Guide to Managing a Microsoft Windows Server 2003 Environment, Enhanced Chapter 11: Monitoring Server Performance.
37 Copyright © 2007, Oracle. All rights reserved. Module 37: Executing Workflow Processes Siebel 8.0 Essentials.
Msdevcon.ru#msdevcon. ИЗ ПЕРВЫХ РУК: ДИАГНОСТИКА ПРИЛОЖЕНИЙ С ПОМОЩЮ ИНСТРУМЕНТОВ VISUAL STUDIO 2012 MAXIM GOLDIN Senior Developer, Microsoft.
IT System Administration Dr Jeffrey A Robinson.
EOH: A Microsoft Partner INTRODUCTION TO EXTENDED EVENTS.
Architecting Availability Groups An analysis of Microsoft SQL Server Always-On Availability Group architectures 1.
Central Management Server Managing Your SQL Server Environment 1.
1 Advanced.Net Debugging Using Visual Studio, R# and OzCode IT Week, Summer 2015.
Log Shipping, Mirroring, Replication and Clustering Which should I use? That depends on a few questions we must ask the user. We will go over these questions.
Creating GP Reports in Excel using Access and ODBC RICHARD WARD MAY 23, 2013.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
Architecting Availability Groups An analysis of Microsoft SQL Server Always-On Availability Group architectures 1.
Session Name Pelin ATICI SQL Premier Field Engineer.
Architecting Availability Groups An analysis of Microsoft SQL Server Always-On Availability Group architectures 1.
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!
Installation The Intercompany Integration Solution for SAP Business One Version 2.0 for SAP Business One 9.1 Welcome to the course on the installation.
Benchmarking like a PRO
What Is The SSIS Catalog and Why Do I Care?
OPERATING SYSTEM CONCEPT AND PRACTISE
Troubleshooting Tools
Extended Events
Hilary Cotter Extended Events.
World Wide Web policy.
Database System Concepts and Architecture
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
Where to Start, What You Need
Installation The Intercompany Integration Solution for SAP Business One Version 2.0 for SAP Business One 9.1 Welcome to the course on the installation.
Simplifying XEvents Management with dbatools
Auditing in SQL Server 2008 DBA-364-M
Building a Performance Monitoring System using XEvents and DMVs
Wellington, SQLSaturday#706
5 Tips for Upgrading Reports to v 6.3
Enterprise Auditing with SQL Server Audit
Targeting Wait Statistics with Extended Events
Programmable Networks
Moving from SQL Profiler to xEvents
Transaction Log Internals and Performance David M Maxwell
Kris Hokanson That’s bad mmmkay! …Or, how to know when your SQL Server isn’t working as well as it could.
Building a Performance Monitoring System using XEvents and DMVs
Presentation transcript:

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 as well. Worked as DBA and Developer in that period. Also work with Oracle, MySQL and Linux In spare time I’m most likely to be found studying a Mathematics degree with the OU, or sat on a bike saddle somewhere remote.

What we’ve had SQL Trace – Server side tracing mechanism SQL Profiler – Client side tool to use SQL Trace

What was wrong with that? Performance hit – All event data captured, and then filtered – Especially bad if run through Profiler

Not the most user friendly of syntax:

So, Extended Events Introduced in SQL Server ‘Extended’ in SQL Server 2008R2 – Unofficial GUI from Codeplex And again in SQL Server 2012 – Now includes all SQL Trace functionality – Official GUI tool in SSMS

SQL Server 2008SQL Server 2008R2SQL Server 2012 action35 48 Event Map Pred_compare Pred_source29 44 Target776 Type29 28 Changes across SQL Server versions

Extendable – New packages can be loaded, for instance for Microsoft Support calls Better performance – Filtering done as early as possible to avoid overheads – You already have a session running and probably not noticed: System_health

Sessions can be told to ‘lose’ events if performance degraded: – Allow_single_event_loss (Default) – Allow_multiple_event_loss – No_event_loss Can persist server restarts

Basic Example Demo

Packages All events, actions, types, etc belong to a Package. Registered packages can be seen in – sys.dm_xe_packages SQL 2012 ships with 8 packages. Others can be installed, usually by MS support for debugging faults

Packages loaded by corresponding module during startup. All events, objects, targets, etc are owned by a package But, all can be used interchangably – Ie; a sqlos event can capture sqlserver actions and record in a package0 target Anything marked ‘private’ is system access only: – SecAudit being the prime example

Sessions All defined event sessions recorded in – sys.server_event_sessions If session is running, it’s recorded in – Sys.dm_xe_sessions

Events The events which can be monitored. – 616 in SQL Server 2012 Select * from sys.dm_xe_objects where object_type=‘event’ and isnull(capability,’’)<>’private’ – Each event is ‘owned’ by a package: select b.name, a.* from sys.dm_xe_objects a inner join sys.dm_xe_packages b on a.package_guid=b.guid where a.object_type='event' and isnull(a.capabilities_desc,'')<>'private'

A session can capture more than one event: Create event session ex1 on server add event sqlserver.sql_statement_starting add event sqlserver.sql_statement_completed add target ring_buffer

‘Payload’ Each event ‘drops’ a payload to the ‘target’: select b.name, a.name, a.type_name, a.description, a.column_type, a.column_value From sys.dm_xe_object_columns a join sys.dm_xe_objects b on a.object_package_guid=b.package_guid and a.object_name=b.name and isnull(b.capability,’’)<>’private’

3 column_type values: – readonly – internal value – data – values returned by default – Customizable – these can be changed, options described in the description field, and default value in the column_value field.

Actions Actions are extra data/payload that can be collected when an event fires: select b.name, b.description, a.* from sys.dm_xe_objects a join sys.dm_xe_packages b on a.package_guid=b.guid where a.object_type='action' and isnull(a.capabilities_desc,'')<>'private';

Predicates Used to filter the events captured: select b.name, a.* From sys.dm_xe_objects a join sys.dm_xe_packages b on a.package_guid=b.guid where a.object_type='pred_source' and isnull(a.capabilities_desc,'')<>'private';

Maps Means of mapping names to values for predicates – For example Wait types to an ID select b.name, a.name, a.map_key, a.map_value, b.description from sys.dm_xe_map_values a inner join sys.dm_xe_objects b on a.object_package_guid=b.package_guid and a.name=b.name order by b.name, a.map_key

Targets Where the data ends up. – A number of different types, main differences: Synchronous Asynchronous Memory resident Persisted storage (disk)

Etw_classic_sync_target – Used for ETW, useful for devs for tracing through large systems but out of scope here Histogram & event_counter – Memory resident tally targets. Histogram used to group data asynchronosyly, counter is a synchronous counter Pair_matching – Memory resident and asynchronous. Used to pair up events, eg; beginning and end of transaction Event_file – Disk based asynchronous target, for bulk or long term retention Ring_Buffer – Memory based asynchronous FIFO target.

Examples 1 – Deadlocks 2 – Possible parameter sniffing 3 – Capture Data file growth 4 – Statement counting 5 – Perfmon stats via GUI

All Good? Not quite: – Can still drag performance down, – Viewing results in GUI still a resource hog But it’s the way forward

References Jonathan Kehayias: – on the load impact of Extended Event sessions: – 31 days of Xevents: MSDN – Overview – Dynamic Management View