0% found this document useful (0 votes)
102 views

Dynamic Management Views

Dynamic management views (DMVs) provide information about the state of SQL Server that can be used for monitoring health, diagnosing issues, and tuning performance. There are two types of DMVs - server-scoped and database-scoped - that are organized into categories including execution, database, index, I/O, replication, and transaction related views. The document provides examples of DMVs within several of these categories that return specific data like I/O statistics, cached query plans, blocking queries, and information on transactions, sessions, and locks.

Uploaded by

venkatesh thula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
102 views

Dynamic Management Views

Dynamic management views (DMVs) provide information about the state of SQL Server that can be used for monitoring health, diagnosing issues, and tuning performance. There are two types of DMVs - server-scoped and database-scoped - that are organized into categories including execution, database, index, I/O, replication, and transaction related views. The document provides examples of DMVs within several of these categories that return specific data like I/O statistics, cached query plans, blocking queries, and information on transactions, sessions, and locks.

Uploaded by

venkatesh thula
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

DYNAMIC MANAGEMENT VIEWS

DMVs return server state information that can be used to monitor the health of a server
instance, diagnose problems, and tune performance. There are two types of DMVs:
 Server-scoped DMVs These require the VIEW SERVER STATE permission on
the server.
 Database-scoped DMVs These require the VIEW DATABASE STATE permission
on the database.
DMVs are organized into the following categories
1) Common Language Runtime Related
2) Database Mirroring Related
3) Database Related
4) Execution Related
5) Full-Text search Related
6) Index Related
7) I/O Related
8) Query Notifications Related
9) Replication Related
10) Service Broker Related
11) SQL Operating System Related
12) Transaction Related

Database Mirroring Related DMVs


1) sys.dm_db_mirroring_connections:- Returns a row for each connection established for
database mirroring.

Database Related DMVs


1) sys.dm_db_file_space_usage:- Returns space usage information for each file in the
database
2) sys.dm_db_session_space_usage:- Returns the number of pages allocated and deallo-
cated by each session for the database
3) sys.dm_db_task_space_usage:- Returns page allocation and deallocation activity by task
for the database (To identify large queries, temporary tables, or table variables that are using
a large amount of tempDB disk space)
4) sys.dm_db_partition_stats:- Returns page and row-count information for every partition
in the current database

Execution Related DMVs


1) sys.dm_exec_requests :- Returns one row for each request executing within SQL Server
(Used for find blocking queries)
2) sys.dm_exec_query_stats:- Returns aggregate performance statistics for cached query
plans.
3) sys.dm_exec_sessions:- Used for information about active sessions
4) sys.dm_exec_cached_plans:- Returns a row for each query plan that is cached by SQL
Server for faster query execution.

1
Index Related DMVs
1) sys.dm_db_index_operational_stats:- Returns current low-level I/O, locking, latching,
and access method activity for each partition of a table or index in the database.
2) sys.dm_db_index_usage_stats:- Returns counts of different types of index operations
and the time each type of operation was last performed.
3) sys.dm_db_missing_index_details:- Returns detailed information about missing indexes.
4) sys.dm_db_index_physical_stats:- Returns size and fragmentation information for the
data and indexes of the specified table or view.

I/O Related DMVs


1) sys.dm_io_backup_tapes:- Returns the list of tape devices and the status of mount
requests for backups
2) sys.dm_io_virtual_file_stats:- Returns I/O statistics for data and log files.

Replication Related DMVs


1) sys.dm_repl_articles:- Returns information about database objects published as articles in
a replication topology.
2) sys.dm_repl_tranhash:- Returns information about transactions being replicated in a
transactional publication.
3) sys.dm_repl_schemas:- Returns information about table columns published by replication.
4) sys.dm_repl_traninfo:- Returns information on each replicated transaction.

SQL Server Operating System Related DMVs


1) sys.dm_os_buffer_descriptors:- Returns information about all the data pages that are
currently in the SQL Server buffer pool.
2) sys.dm_os_memory_cache_counters:- Used for check the health of the system memory
cache
3) sys.dm_os_memory_objects:- Returns memory objects that are currently allocated by
SQL Server. sys.dm_os_memory_objects is primarily used to analyze memory use and to
identify possible memory leaks.
4) sys.dm_os_tasks:- Returns one row for each task that is active in the instance of SQL
Server.
5) sys.dm_os_threads:- Returns a list of all SQL Server Operating System threads that are
running under the SQL Server process.
6) sys.dm_os_performance_counters:- Returns a row per performance counter maintained
by the server.

Transaction Related DMVs


1) sys.dm_tran_database_transactions:- Returns information about transactions at the
database level.
2) sys.dm_tran_session_transactions:- Returns correlation information for associated
transactions and sessions
3) sys.dm_tran_transactions_snapshot:- Returns a virtual table for the
sequence_number of transactions that are active when each snapshot transaction starts
4) sys.dm_tran_active_transactions:- Returns information about transactions for the SQL
Server instance.
5) sys.dm_tran_current_transaction:- Returns a single row that displays the state
information of the transaction in the current session
6) sys.dm_tran_locks :- Returns information about currently active lock manager resources.
Each row represents a currently active request to the lock manager for a lock that has been
granted or is waiting to be granted.

You might also like