Sunday 13 April 2014

What is Dynamic management view?

 No one likes problem .DMV helps to understand the problem before it occurs.Really it helps
to quick discover the slowest SQL queries on SQL servers.It helps to get details of missing
indexes that could significantly improve the performance of queries. All these things and more
are easily possible, typically in a matter of seconds, using DMVs.
  DMVs are views on internal SQL Server metadata, which can be used to significantly improve
the performance of SQL queries, often by an order of magnitude.Fixing any problem is knowing
what the underlying problem is. DMVs can give precisely this information. DMVs will pinpoint
where many of problems are, often before they become painfully apparent.DMV are existing from
SQL Server 2005.After executing sql queries on a SQL Server database, SQL Server automatically
records information about the activity that is taking place, internally into structures in memory, this information can be accessed via DMVs. So DMVs are basically SQL views on some pretty important internal memory structures.DMV information includes metrics that relate to indexes, query execution,  service broker, replication, query notification, objects,input/output (I/O), full-text search, databases, database mirroring, change data capture(CDC),the operating system, common language runtime (CLR), transactions, security, extended events, resource governor and much more. 
     When any query execute  on sql server following information captured 
 1.The query’s cached plan 
 2.What indexes were used
 3.What indexes the query would like to use but are missing
 4.What resources the query waiting upon
 5.How much IO occurred (both physical and logical)
 6.How much time was spent actually executing the query
 7.How much time was spent waiting on other resources.
    In addition to DMVs, there are several related functions that work in conjunction with DMVs, called Dynamic Management Functions (DMFs). In many ways DMFs are similar to standard SQL
functions, being called repeatedly with a DMV supplied parameter.DMVs and DMFs have been an integral part of SQL Server since version 2005 onwards. In SQL Server 2005 there are 89 DMVs (and DMFs), and in SQL Server 2008 there are 136 DMVs.  It is possible to discover the range of these DMVs by examining their names, by using the following query:
SELECT name, type_desc FROM sys.system_objects WHERE name LIKE 'dm_%' ORDER BY name
    DMVs can solve  problem including  Diagnosing , Performance Tuning, and Monitoring.
It is possible to query the DMVs to diagnose many common problems including slowest queries, the commonest causes of waiting/blocking, unused indexes, files having the most I/O, and lowest re-use of cached plans.

No comments:

Post a Comment

First Database In Sql Server