The Essentials: DMV’s and T-SQL for the DBA Rocky Mountain Tech Tri-Fecta.

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

Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
Burt King We will cover: Essentials --No command line needed here (mott) What is SQL Server How does it come to life What are the.
ManageEngine ® SQLDBManager Plus - Product Overview.
Presented by Brad Gall Using BI Techniques for Database Statistics.
Balmukund Lakhani Technical Lead – SQL Support Team
SQL Server 2005 Database Engine Sommarkollo Microsoft.
ARIE D. JONES (AJ) PRINCIPAL TECHNOLOGY MANAGER SQL Server for the Oracle DBA Sept 16 th 2009.
Gavin Payne Oracle for SQL Server DBAs. Why Oracle? Installation Physical Storage Backup and Recovery 20 slides in 50 minutes Inside the database Programmability.
Graeme Scott – Technology Solution Professional Reduce Infrastructure Costs & Increase Productivity with SQL Server 2008.
ManageEngine ® SQLDBManager Plus - Product Overview.
Anil Desai Austin CodeCamp  Anil Desai ◦ Independent consultant (Austin, TX) ◦ Author of several SQL Server books ◦ Instructor, “Implementing and.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Managing and Monitoring SQL Server 2005 Shankar Pal Program Manager SQL Server, Redmond.
SQL Azure Administration and Application Self-Servicing Michal Lesiczka Program Manager Microsoft Corporation Vinod Jagannathan Program Manager Microsoft.
Discover, Master, InfluenceSlide 1 SQL Server Compact Edition and the Entity Framework Rob Sanders Readify.
Connect with life Praveen Srvatsa Director | AsthraSoft Consulting Microsoft Regional Director, Bangalore Microsoft MVP, ASP.NET.
Manage & Configure SQL Database on the Cloud Haishi Bai Technical Evangelist Microsoft.
XVII Encontro – 29/11/2011. Virgílio Esteves ID&T – Research & Founder of NetPonto Coimbra C# / WPF / Silverlight / XNA / Azure.
Module 18 Monitoring SQL Server 2008 R2. Module Overview Monitoring Activity Capturing and Managing Performance Data Analyzing Collected Performance Data.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.
Key Concepts About Performance Factors Affecting SQL Performance SQL Performance Tuning Methodologies SQL Performance Tuning Tools 1.
Introducing the SQL Server 2008 Performance Data Collector by Brad McGehee August 20, 2008 Audio via phone conference (866) , the dial in code.
Module 7 Reading SQL Server® 2008 R2 Execution Plans.
SQL Server 2005 – Dynamic Management Views & Functions Whitney Weaver Senior Consultant
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
Agenda for Today Do Chapter 14 Final Project Review for Final.
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 – Profiling and Monitoring Tools.
It Depends Database administration for developers.
SQLRX – SQL Server Administration – Tips From the Trenches SQL Server Administration – Tips From the Trenches Troubleshooting Reports of Sudden Slowdowns.
SQL Dev Tips for Small Workstations How to develop SQL on small dev workstations when prod is huge. Kevin Kline and Aaron Bertrand SQL Sentry.
Introduction to Oracle. Oracle History 1979 Oracle Release client/server relational database 1989 Oracle Oracle 8 (object relational) 1999.
SQL Server 2000 Sys Admin Jeremiah Curtis Engineering Services
SharePoint enhancements through SQL Server RSS integration with SharePoint What’s New Elimination of IIS
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.
Interpreting DMV’s & practical uses Jannie Muller mullerjannie.wordpress.com.
Matt Lavery & Joanna Podgoetsky Being a DBA is cool again with SQL 2016 DAT335 A.
Gail Shaw XpertEase DAT 305 Topics Background Information Query Hints Plan Cache Metadata Plan Guides Plan Freezing Monitoring Plan Guide Use.
Meta Data Cardinality Explored CSSQLUG User Group - June 2009.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
Scott Fallen Sales Engineer, SQL Sentry Blog: scottfallen.blogspot.com.
Linkedin: dennisegraham Dennis E Graham Reporting For SQL Health.
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.
High Performance Functions SQLBits VI. Going backwards is faster than going forwards.
Improve query performance with the new SQL Server 2016 query store!! Michelle Gutzait Principal Consultant at
Meeting Date: September 27, 2007 Topic: Converting DTS to SSIS by Brian Knight.
FUN WITH AVAILABILITY GROUPS Christopher Wolff SQL Server Database Engineer, Xero.
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.
Introducing Hekaton The next step in SQL Server OLTP performance Mladen Prajdić
Query Optimization Techniques
Troubleshooting SQL Server high CPU usage
SQL Server Data Collector From Every Angle
SQL Server Monitoring Overview
Microsoft ASP.NET Connections
Root Cause Analysis with DMVs
Peeking into the Plan Cache with SQL Server 2008
Performance Monitoring Using Extended Events, DMVs & Query Store
SQL Server 2008 Systems Management
Dynamic Management Views a practical overview!
Kris Hokanson That’s bad mmmkay! …Or, how to know when your SQL Server isn’t working as well as it could.
Dynamic Management Views a practical overview!
Governing Your Enterprise with Policy-Based Management
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Jean Joseph DBA/Developer
Using wait stats to determine why my server is slow
Advanced Database Topics
Analyzing Performance Problems Using XEvents, DMVs & Query Store
Presentation transcript:

The Essentials: DMV’s and T-SQL for the DBA Rocky Mountain Tech Tri-Fecta

About Me Over a decade with SQL Server – Employee, Contractor, Consultant Principal Blog sqlPerspectives.wordpress.com DataRealized.wordpress.com Speaker Dev Connections, SSWUG v-Conference, User Groups Rocky Mountain Tech Tri-Fecta

The Essentials: DMV’s and T-SQL for the DBA Agenda – DMV’s Categories Dive in and try them out – T-SQL for internals / DMV’s Utilizing DMV’s How DMV’s can work for you DDL Triggers Plan Guides Rocky Mountain Tech Tri-Fecta

DMV’s DMV – Definition Dynamic Management Views (and functions) – Return server state information that can be used to monitor the health of a server instance, diagnose problems, and tune performance.* MSFT – 2008 BOL Rocky Mountain Tech Tri-Fecta

DMV Categories » Change Data Capture Related Dynamic Management Views » Query Notifications Related Dynamic Management Views » Common Language Runtime Related Dynamic Management Views » Replication Related Dynamic Management Views » Database Mirroring Related Dynamic Management Views » Resource Governor Dynamic Management Views » Database Related Dynamic Management Views » Service Broker Related Dynamic Management Views » Execution Related Dynamic Management Views and Functions » SQL Server Extended Events Dynamic Management Views » Full-Text Search Related Dynamic Management Views » SQL Server Operating System Related Dynamic Management Views » Index Related Dynamic Management Views and Functions » Transaction Related Dynamic Management Views and Functions » I/O Related Dynamic Management Views and Functions » Security Related Dynamic Management Views » Object Related Dynamic Management Views and Functions Rocky Mountain Tech Tri-Fecta

DMV’s Challenge – Increasingly large environments – Increasingly complex environments Hardware / Database consolidation SQL Server “Sprawl” – Toolset knowledge needed… increasing, quickly » Revamped DTS to SSIS » Revamped SSRS » Improved SSAS » CLR, FileStream, CTE’s, Spatial Datatypes, compression, ABC’s, XYZ’s Rocky Mountain Tech Tri-Fecta

DMV’s DMV - The toolset you can’t live without! Two scopes: – Server & Database Live in the sys Schema Queries for nearly everything – Tuning, Performance related issues, Backup history, Index analysis, Memory, Disk and CPU analysis SQL Server 2008 – Additional 46 DMV’s Rocky Mountain Tech Tri-Fecta

Key DMV’s – Sys.dm_os_sys_info – General Server Info – Sys.dm_exec_requests – Sp_who(2) +++ – Sys.dm_db_index_operational_stats – Sp_lock +++ – Sys.dm_db_index_usage_stats – Base DMV for Index Analysis and Recommendations – Msdb.dbo.backupset – Base table for backup history Rocky Mountain Tech Tri-Fecta

Key DMV’s – Sys.dm_exec_cached_plans – Shows query plans that are cached by SQL Server – For query plans, this DMV maps to the syscacheobjects table in SQL Server 2000 – Sys.dm_exec_query_stats – Performance statistics for cached query plans – Top 10 … – Sys.dm_io_virtual_file_stats – I/O stats for data and log files – Sys.dm_os_memory_pools – Monitors Cache memory Rocky Mountain Tech Tri-Fecta

Key DMV’s – Sys.dm_exec_sql_text – Returns the text of the SQL batch that is identified by the specified sql_handle. – This table-valued function replaces the system function fn_get_sql – Obtained from: » Sys.dm_exec_query_stats » Sys.dm_exec_requests » Sys.dm_exec_cursors » Sys.dm_exec_xml_handles » Sys.dm_exec_query_memory_grants » Sys.dm_exec_connections Rocky Mountain Tech Tri-Fecta

DMV Demo Putting it together… Physical Environment – CPU, Memory, SQL Server start time Backup History – Server, Database, Size, Duration etc… SP_who…? – Tons of great information Indexing – Usage, Analysis, Good, Bad… T-SQL statements – Good or Bad, how can you tell? Rocky Mountain Tech Tri-Fecta

DMV Demo Putting it together… Cache – Adhoc / dynamic – Re-using of cache plans? – Memory breakdown of all compiled objects Set Options – Which ones? Top 10 – Physical Reads – Logical Reads Rocky Mountain Tech Tri-Fecta

DDL Triggers GREAT for auditing changes – What changed? – Who changed it? – When did it change? – Quick Demo – *note the Create_Statistics criteria in the Create Trigger Rocky Mountain Tech Tri-Fecta

Plan Guides Demo Putting it together… Cache Things to look for : – Determine if the adhoc or dynamic statements are generating plans that are re-used, or in this case, not being re-used. select Count (*), refcounts, usecounts, objtype, left(text,50) from sys.dm_Exec_cached_plans cross apply sys.dm_exec_sql_text(plan_handle) where cacheobjtype = 'Compiled Plan’ and objtype = 'Adhoc' and usecounts = 1 group by refcounts, usecounts, objtype, left(text,50) order by 1 desc CountRefcountUsecountobjtypesql – first 50 characters… AdhocSelect DISTINCT TOP 100 W………… AdhocSELECT TOP 1000 W……… Adhocselect distinct top 100 v.W……… – Means that there are 4811 plans for three nearly identical statements – Significant memory required for caching plans – Finite amount of cache for plans Rocky Mountain Tech Tri-Fecta

The Essentials – DMV’s and T-SQL for the DBA Summary – DMV’s Meta-Data for your enterprise Help yourself, your team and your management – DDL Trigger – Consistency, consistency, consistency – Great audit tool – Plan Guides DMV Meta-Data drives exact prescription HAVE FUN! Rocky Mountain Tech Tri-Fecta

The Essentials – DMV’s and T-SQL for the DBA Resources – Rocky Mountain Tri-Fecta! – Local User Group – SQL Server Books On Line – SQL Server 2008 Performance Studio Rocky Mountain Tech Tri-Fecta

The Essentials – DMV’s and T-SQL for the DBA Thank you! – Questions DataRealized.com Rocky Mountain Tech Tri-Fecta