Wellington, SQLSaturday#706

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

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+
Module 2: Database Architecture
SQL Server memory architecture and debugging memory Issues
© 2011 IBM Corporation 11 April 2011 IDS Architecture.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Informix IDS Administration with the New Server Studio 4.0 By Lester Knutsen My experience with the beta of Server Studio and the new Informix database.
Architecture Rajesh. Components of Database Engine.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
© 2008 Quest Software, Inc. ALL RIGHTS RESERVED. Perfmon and Profiler 101.
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.
Alwayson Availability Groups
Transaction Log Internals Dharmendra Keshari President - KDSSG.
EOH: A Microsoft Partner INTRODUCTION TO EXTENDED EVENTS.
Stored Procedures / Session 4/ 1 of 41 Session 4 Module 7: Introducing stored procedures Module 8: More about stored procedures.
TOP 10 Thinks you shouldn’t do with/in your database
SQL Server 2016 – New Features Tilahun Endihnew March 12, 2016.
C:\Users\> t An affair with SQL Server for nearly a decade Was part of SQL Escalation Services and Premier Field Engineering team.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
Configuring SQL Server for a successful SharePoint Server Deployment Haaron Gonzalez Solution Architect & Consultant Microsoft MVP SharePoint Server
Oracle Database Architectural Components
C:\Users\> whoami Known on Twitter t An affair with SQL Server for nearly a decade Was part of SQL Escalation Services and Premier Field.
Session Name Pelin ATICI SQL Premier Field Engineer.
SQL 2012 – Always On Deep Dive Bob Duffy Database Architect Prodata SQL Centre of Excellence 11 th April 2013.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
MANAGEMENT DATA WAREHOUSE AND DATA COLLECTOR Ian Lanham.
SQL Server Storage Inside. About Hemantgiri S. Goswami Hemantgiri S. Goswami is a Lead Database Consultant for Pythian, a company head quartered in Ottawa,
SQL Saturday #509 | Brisbane 2016 #509 | Brisbane 2016 Martin Catherall Moving from Profiler to Extended Events.
SQL Database Management
An introduction to Wait Statistics
In-Memory Capabilities
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
A Day in the Life of a Row Eddie Wuerch, mcm
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Building a Performance Monitoring System using XEvents and DMVs
SQL Server Internals Overview
Building a Performance Monitoring System using XEvents and DMVs
Parameter Sniffing in SQL Server Stored Procedures
SQL Server Monitoring Overview
Extend Your Knowledge with Extended Events!
Chapter Overview Understanding the Database Architecture
Hustle and Bustle of SQL Pages
Simplifying XEvents Management with dbatools
Auditing in SQL Server 2008 DBA-364-M
Building a Performance Monitoring System using XEvents and DMVs
The Vocabulary of Performance Tuning
Troubleshooting Availability Group Failovers
SQL 2014 In-Memory OLTP What, Why, and How
What Is a Latch? …and Why Do I Care? Eddie Wuerch, mcm
Microsoft SQL Server 2014 for Oracle DBAs Module 3
Migrating your SQL Server Instance
SQL Server 2016 Query Data Store
Troubleshooting Techniques(*)
SQL Server Performance Tuning
Moving from SQL Profiler to xEvents
It’s TEMPDB Why Should You Care?
The Vocabulary of Performance Tuning
Diving into Query Execution Plans
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Building a Performance Monitoring System using XEvents and DMVs
Database administration
The Vocabulary of Performance Tuning
Using wait stats to determine why my server is slow
Inside the Database Engine
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Inside the Database Engine
Inside the Database Engine
Presentation transcript:

Wellington, SQLSaturday#706 Troubleshooting With Extended Events Wellington, SQLSaturday#706 Dharmendra Keshari Sr. Database Administrator

Who Am I C:\> Dharmendra Keshari is a Microsoft Data Platform MVP. He has been organizing world renowned events like SQL Saturday (Singapore), also a co-organizer of KDSSG MSSQL Tech Unite events (in India), and also a core member of “Singapore SQL PASS Chapter”. He also frequently blogs on his website and also a regular contributor at sqlservercentral.com Currently working as Senior Database Administrator at Micron Technology, Singapore. He has worked in a variety of roles including SQL DBA, Windows/Hyper-V Administrator and also worked very closely with Storage team and vendor management which have given him extensive experience planning and implementing large-scale environment changes and upgrades. In his free time, Dharmendra loves to hang out with family & friends, joining Marathons and spend time reading on SQL Server new technology developments. Reachable at: https://sg.linkedin.com/in/dharmendra-keshari-a7043398 https://www.facebook.com/dharmendra.keshari.9 dharmendra.keshari@gmail.com | dharmendra.keshari@kdssg.com

Agenda Introduction Replace SQL Trace Enhancements – xEvents Vs SQLTrace Extended Events Architecture System Health – Historical Data TempDB Contention Issue 3 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

Introduction What is Extended Events SQL Server Extended Events is a general event-handling system for SQL Server systems. “The Extended Events infrastructure supports the correlation of data from SQL Server.” https://technet.microsoft.com/en-us/library/bb630354%28v=sql.105%29.aspx Simpler version There is an infrastructure within SQLOS known as Extended Events infrastructure. It allows us to create sessions which collect event data for analysis & troubleshooting and helps to understand what’s going on inside SQL Server. 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

Replace SQL Trace Implementation of SQL Trace is very limiting to flexibility Filtering can be only applied once the event has been fired completely; not at the beginning Negative impacts on performance during event collection Does not generate trace name globally, you have to code to get it done Cannot do any kind of analysis without using T-SQL Cannot capture new features information, like in-memory, AlwaysOn ,and many more … 18 Years old technology (Introduced in 1998) No enhancements after SQL Server 2005 MSDN says it will be deprecated soon 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

Enhancements – xEvents Vs SQLTrace Extended Events More events introduced adaptive_join_skipped excessive_memory spilled_to_workfiles SQL Server 2017 1503 More events introduced ** Insufficient memory to process hash_spill_details ** Detailed Backup Info Backup_restore_progress_trace Database_backup_restore_through put SQL Server 2016 1301 Number of xEvents or SQLTrace Events SSMS Addin Adoption increase a lot compare previous versions - More events introduced SQL Server 2014 870 - GUI Option introduced - Easy to use! A bit more adoption compare to SQL 2K8 & 2K8R2 - More events introduced SQL Server 2012 625 - XEvents introduced - No GUI option - T-SQL only option - Data returned as XML - Low adoption SQL Server 2008 & R2 243 262 SQL Server Trace SQL Server 2012 SQL Server 2014 SQL Server 2016 SQL Server 2017 180 SQL Server 2008 & R2 SQL Server 2008 SQL Server Versions 6 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

Extended Events Architecture Extended Events Engine Events Registered Packages & Medadata Dispatcher Pool Event Sessions Buffers Targets Dispatcher Events Actions Types Maps Targets Predicates Store_Procedure SP_Started SP_completed - etc Column Selection Session_ID Database_ID - etc Data Types It defines the data Type for an event column, action or global predicate It provides mapping from Key value to text value. For Example Exclusive lock Key value=5 Text value=‘X’ Target is final destination where you are going to put the data It is a ‘where’ clause. 7 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

SQLSaturday#706 Wellington, New Zealand 2018 8 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

System Health – Historical Data In SQL 2012 onwards, SP_Server_Diagnostics executes every 5 minus Intervals to check the current health of the SQL Instance It provides the following sections of health information: CPU, Page faults, Non-yielding tasks, latches, dumps and spinlock Physical and Virtual memory usage Max workers, idle workers, tasks completed in interval Long interval I/O, I/O Latch timeout, I/O pending requests Buffer Exception, Ring buffer, Buffer Pool, Scheduler Monitor SP_Server_Diagnostics is collected by the System_Health session and written to a file which can be trended over longer period of time. Even it is available, if the SQL instance restart or crash. Recreating the System_health or other inbuilt Extended Events sessions: 9 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

SQLSaturday#706 Wellington, New Zealand 2018 10 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

TempDB Contention Issue (1)… Let’s see what all the activities which uses Tempdb Temporary Tables Sort Worktables Service Broker CHECKDB Cursors Merge Joins XML Documents Table Variables User Objects User Defined Objects Version Store Internal Objects Temporary Procedures Table valued parameters Online Index Space Workfile Hash Joins (Temporary Storage for hashing) 11 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

TempDB Contention Issue (2)… Object (Table or Index) Database PFS 8KB PFS tracks allocated pages & heap page free space in a DB. It can store information about roughly 64MB of pages. (2:1:1) GAM 8KB Global Allocation Map tracks uniform allocated extents. A new GAM page store information roughly 4GB intervals in a data file (2:1:2) SGAM 8KB Shared Global Allocation Map tracks mixed allocated extents. A new SGAM page store information roughly 4GB intervals in a data file 8KB 8KB 8KB 8KB 8KB 8KB 8KB 8KB 8KB 8KB 8KB 12 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

SQLSaturday#706 Wellington, New Zealand 2018 13 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

Frequent Recompilation of Queries (1)… Execution was normal. There was no change which caused to recompile the query plan When query plan get complied because x change, you will get map value “Recompiled” When execution plan will be flushed, you will get the map value “Execution Plan Flush” 14 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

Frequent Recompilation of Queries (2)… 15 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

SQLSaturday#706 Wellington, New Zealand 2018 16 | 11/18/2018 | SQLSaturday#706 Wellington, New Zealand 2018

Thank you for attending!!!