top of page

DMVs for SQL Database

SQL Database is the Azure version of SQL server. We can use the following DMVs to monitor SQL Database performance:

sys.database_connection_stats

Count successful and failed connections. The count of failed connections is the sum of login failures, terminated connections, and throttled connections.

sys.dm_db_resource_stats

Get the resource consumption percentages for CPU, data IO, and log IO. It returns one row for every 15 seconds, even when there is no activity in the database. For less granular data, you can use sys.resource_stats in the logical master database for your server.

sys.dm_exec_query_stats

In combination with sys.dm_exec_sql_text, find queries that use a lot of resources, such as CPU time or IO.

sys.dm_tran_locks

Discover blocked queries.

sys.event_log

Find issues such as deadlocking and throttling over the last 30 days. You must have permission to read the master database on the Azure server. As an example, you can search for specific types of events, such as deadlocks or throttle events, and when they occurred, as follows,

SELECT Event_Category, Event_Type, Event_Subtype_Desc, Event_Count, Description, Start_Time FROM sys.event_log WHERE

Event_Type = 'deadlock' OR Event_Type like 'throttling%'

 

Example:

Answer:


bottom of page