Dynamic Management Views a practical overview!

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.
Presented by Brad Gall Using BI Techniques for Database Statistics.
The Essentials: DMV’s and T-SQL for the DBA Rocky Mountain Tech Tri-Fecta.
SQL Azure Administration and Application Self-Servicing Michal Lesiczka Program Manager Microsoft Corporation Vinod Jagannathan Program Manager Microsoft.
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 |
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
Danette Dineen Riviello Magellan Health March 17,
DMV Performance Monitoring & Tuning Presented by Franklin Yamamoto.
It Depends Database administration for developers.
Enterprise Database Administration & Deployment SIG ▪ 313M ▪ Sept 29, 2005 ▪ 10:15 AM SQL Server 2005 Performance Diagnosis and Tuning using SQL Tools.
Interpreting DMV’s & practical uses Jannie Muller mullerjannie.wordpress.com.
Analysing Indexes SQLBits 6 th October 2007 © Colin Leversuch-Roberts Kelem Consulting Limited September 2007.
Impala. Impala: Goals General-purpose SQL query engine for Hadoop High performance – C++ implementation – runtime code generation (using LLVM) – direct.
Gail Shaw XpertEase DAT 305 Topics Background Information Query Hints Plan Cache Metadata Plan Guides Plan Freezing Monitoring Plan Guide Use.
Oracle Business Intelligence Foundation – Testing and Deploying OBI Repository.
Diagnosing Performance with Wait Statistics Robert L Davis Principal Database
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
SQL Server Deep Dive Denis Reznik Data Architect at Intapp.
Why Should I Care About … The Plan Cache? Tuning When Stakeholders Won’t Say Where It Hurts.
Linkedin: dennisegraham Dennis E Graham Reporting For SQL Health.
Oracle Database Architectural Components
With Temporal Tables and More
Standard/Express edition
SQL Trace and TKPROF.
How Good Is Your Indexing Strategy?
Troubleshooting SQL Server high CPU usage
Building a Performance Monitoring System using XEvents and DMVs
Query Performance Tuning: Start to Finish
CS422 Principles of Database Systems Course Overview
Become a SQL Server Performance Detective
Things You Can Find in the Plan Cache.
TechEd /24/2018 8:28 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks.
Troubleshooting SQL Server When You Cannot Access The Machine
Building a Performance Monitoring System using XEvents and DMVs
Become a SQL Server Performance Detective
SQL Server Monitoring Overview
Database Performance Tuning and Query Optimization
Microsoft Dumps Question Answer - Dumps4download
Reading Execution Plans Successfully
Root Cause Analysis with DMVs
Download Latest Certification Practice Question Answers – Realexamdumps.com
Download Microsoft Exam Dumps - Valid Microsoft Question Answers - Realexamdumps.com
Peeking into the Plan Cache with SQL Server 2008
Performance Monitoring Using Extended Events, DMVs & Query Store
Building a Performance Monitoring System using XEvents and DMVs
Getting To Know Your Indexes
Twitter Sr. SQL Premier Field Engineer Twitter LinkedIn: sam mesel Query Store.
SQL Server 2016 Query Data Store
Reading Execution Plans Successfully
මොඩියුල විශ්ලේෂණය SQL Server Waits. Tables රැසක් එකට එකතු කිරීම.
Indexing For Optimal Performance
Batches, Transactions, & Errors
Kris Hokanson That’s bad mmmkay! …Or, how to know when your SQL Server isn’t working as well as it could.
Chapter 11 Database Performance Tuning and Query Optimization
Dynamic Management Views a practical overview!
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Jean Joseph DBA/Developer
Building a Performance Monitoring System using XEvents and DMVs
04 | Performance and the Premium SKU
Reading execution plans successfully
Inside the Database Engine
Developing Microsoft SQL Server Databases
Advanced Database Topics
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Inside the Database Engine
Inside the Database Engine
Presentation transcript:

Dynamic Management Views a practical overview!

Introduction Who the Heck am I? 0: Module Name Introduction Who the Heck am I? I am a Nice person in the “What the Hell is Wrong with Me, kind of way” Why do we need this? Because DMVs Rock!!!!! What is the scope? Everything and anything we can fit in! Who will benefit and why? Unfortunately depends entirely on the individuals own cognitive reasoning and ability  Course Title © 2007 Education Experiences Inc. 1/1/2007

0: Module Name Course Title © 2007 Education Experiences Inc. 1/1/2007

0: Module Name Course Title © 2007 Education Experiences Inc. 1/1/2007

The Real Facts Dynamic Management Objects (DMOs) (The real name) 0: Module Name The Real Facts Dynamic Management Objects (DMOs) (The real name) They exist in the “sys” schema !!!!!!! Called Dynamic as the data is merely a tabular view of instrumentation points within SQL. These can be Point in Time as well as Cumulative. (Shift F1 when in Doubt) Dynamic management Views Dynamic management Functions Helpers come in the form of: System Compatibility Views System Catalog Views Course Title © 2007 Education Experiences Inc. 1/1/2007

Connections, Sessions & Requests 0: Module Name Connections, Sessions & Requests Course Title © 2007 Education Experiences Inc. 1/1/2007

Connections, Sessions & Requests 0: Module Name Connections, Sessions & Requests • sys.dm_exec_sessions • sys.dm_exec_requests • sys.dm_exec_connections Helpers • sys.dm_exec_sql_text • sys.dm_exec_query_plan Course Title © 2007 Education Experiences Inc. 1/1/2007

Lets start with “sys.dm_exec_sessions” 0: Module Name Lets start with “sys.dm_exec_sessions” Provides us with very useful metrics. total_elapsed_time last_request_start_time last_request_end_time cpu_time memory_usage And the list goes on! PS – Internal Session are <=50 ( <51), often with Nulls in many of the columns Course Title © 2007 Education Experiences Inc. 1/1/2007

So what can we do with “sys.dm_exec_sessions”? 0: Module Name So what can we do with “sys.dm_exec_sessions”? Course Title © 2007 Education Experiences Inc. 1/1/2007

“sys.dm_exec_requests” 0: Module Name “sys.dm_exec_requests” Broken down into 3 groups: Id Columns – session_id, connection_id, transaction_id Blocking/Locking – blockingsession_id, wait_type, wait_state, wait_time, wait_resource Activity/Workload – percent_complete, cpu_time, row_count, granted_query memory, reads, writes, logical_reads Course Title © 2007 Education Experiences Inc. 1/1/2007

So what can we do with “sys.dm_exec_requests”? 0: Module Name So what can we do with “sys.dm_exec_requests”? Course Title © 2007 Education Experiences Inc. 1/1/2007

Connections, Sessions & Requests: Summary!!! 0: Module Name Connections, Sessions & Requests: Summary!!! • See who is connected? • What Sessions are in play? • What they are running? • What they are using to run things? • Who is Context Switching? • Who is Inactive or Idle? These allow you to deal with immediate problems. A better approach is however needed for long term solutions to finding problems that need tuning. Course Title © 2007 Education Experiences Inc. 1/1/2007

Query Plan Metadata &Statistics 0: Module Name Query Plan Metadata &Statistics Course Title © 2007 Education Experiences Inc. 1/1/2007

Metadata and Statistics 0: Module Name Metadata and Statistics sys.dm_exec_query_stats – returns aggregated performance statistics for a cached query plan. Returns one row per statement within the plan. sys.dm_exec_procedure_stats – returns aggregated performance statistics for cached stored procedures (SQL Server 2008 only). Returns one row per stored procedure. sys.dm_exec_cached_plans – provides detailed information about a cached plan, such as the number of times it has been used, its size, and so on. Returns a row for each cached plan. sys.dm_exec_query_optimizer_info – returns statistics regarding the operation of the query optimizer, to identify any potential optimization problems. For example, you can find out how many queries have been optimized since the last time the server was restarted. Course Title © 2007 Education Experiences Inc. 1/1/2007

0: Module Name Helpers • sys.dm_exec_query_plan – returns in XML format the query plan, identified by a plan_handle, for a SQL batch. • sys.dm_exec_text_query_plan – returns in text format the query plan, identified by a plan_handle, for a SQL batch or, via the use of this DMF's offset columns, a specific statement within that batch. • sys.dm_exec_plan_attributes – provides information about various attributes of a query plan, identified by a plan_handle, such as the number of queries currently using a given execution plan. It returns one row for each attribute Course Title © 2007 Education Experiences Inc. 1/1/2007

What does all this Metadata give us? 0: Module Name What does all this Metadata give us? Course Title © 2007 Education Experiences Inc. 1/1/2007

MetaData and Statistics Summary 0: Module Name MetaData and Statistics Summary • We can Extract Plans! • We can extract Execution Text! • Performance Metrics! • What did the optimizer do? Allows us to investigate query health of the system! Course Title © 2007 Education Experiences Inc. 1/1/2007

SQL Transactions 0: Module Name Course Title © 2007 Education Experiences Inc. 1/1/2007

0: Module Name SQL Transactions Needed to ensure ACID properties of the Database and allows us to: Determine Locking. Determine Blocking. Isolation Levels Some of the main players sys.dm_tran_active_transactions sys.dm_tran_locks sys.dm_tran_session_transactions sys.dm_tran_active_snapshot_database_transactions sys.dm_tran_transactions_snapshot sys.dm_tran_currrent_snapshot Course Title © 2007 Education Experiences Inc. 1/1/2007

What can we get from Transaction DMV’s 0: Module Name What can we get from Transaction DMV’s Course Title © 2007 Education Experiences Inc. 1/1/2007

0: Module Name Transaction Summary • We can track Blocking • We can track Locking • Snapshot Isolation Levels are less of a mystery Course Title © 2007 Education Experiences Inc. 1/1/2007

Indexing 0: Module Name Course Title © 2007 Education Experiences Inc. 1/1/2007

Indexing We all know why we need them! 0: Module Name Indexing We all know why we need them! SSMS gives only individual Index hints: View them subjectively and in some cases critically as the hinted index might not work well for your overall environment. Can’t play in this arena without using the Catalog views to Help Out. The main Players: sys.dm_db_index_usage_stats sys.dm_db_index_operational_stats sys.dm_db_missing_index_group_stats sys.dm_db_missing_index_groups sys.dm_db_missing_index_details Course Title © 2007 Education Experiences Inc. 1/1/2007

Indexing Application 0: Module Name Course Title © 2007 Education Experiences Inc. 1/1/2007

Indexing Summary • Find potential Missing Indexes 0: Module Name Indexing Summary • Find potential Missing Indexes • We can dive into Index activity and gauge performance and value Used Unused Underperforming Course Title © 2007 Education Experiences Inc. 1/1/2007

0: Module Name Conclusion It's not enough just to understand the metadata values for the DMOs. Before acting on this data, you must also know and understand your environment, your data, and your users. Sean.Cremer@Derivco.com (If you are desperate and google is not enough) (Credit to the following: Ian Stirk, Louis Davidson, Tim Ford, Brent Ozar) Course Title © 2007 Education Experiences Inc. 1/1/2007