DP-300 Practice Question: Monitor, configure, and optimize database resources
You need to monitor the long-running queries in an Azure SQL Database. Which dynamic management view should you query to see queries that have been running for more than 30 seconds?
⚠ Common exam trap
The trap is confusing DMVs that show aggregate statistics (sys.dm_exec_query_stats) with those that show real-time active requests (sys.dm_exec_requests); candidates often pick the former because it sounds like it tracks query performance, but it does not show currently running queries.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
sys.dm_exec_requests
sys.dm_exec_requests is the correct DMV because it returns one row per active request currently executing on the SQL Server instance, including the total elapsed time. You can filter on total_elapsed_time > 30000 to find queries running longer than 30 seconds. It also provides session_id, status, command, and wait information, making it ideal for identifying long-running queries.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
sys.dm_exec_requests
Why this is correct
sys.dm_exec_requests exposes one row per currently executing request, including a total_elapsed_time column, so filtering on total_elapsed_time > 30000 returns queries running over 30 seconds. It satisfies the stem's requirement to monitor long-running queries directly, unlike completed-query or historical views.
- ✗
sys.dm_db_resource_stats
Why it's wrong here
sys.dm_db_resource_stats reports CPU, IO and memory consumption against Azure SQL Database limits, not query text or elapsed runtime, so it cannot identify queries exceeding 30 seconds. It is tempting because it is the go-to DMV for resource saturation troubleshooting, which is the correct choice when diagnosing throttling rather than long-running statements.
- ✗
sys.dm_exec_sessions
Why it's wrong here
sys.dm_exec_sessions returns one row per session with login and status metadata, not per-statement elapsed time, so it cannot filter statements running beyond 30 seconds. It is tempting because it exposes session-level details such as status and last request time, which suits identifying idle or blocked sessions rather than long-running queries.
- ✗
sys.dm_exec_query_stats
Why it's wrong here
sys.dm_exec_query_stats aggregates cumulative execution statistics per cached plan, so it cannot report a currently running query's elapsed time against a 30-second threshold. It is tempting because it is the standard DMV for finding historically expensive queries by CPU, reads or duration, which suits performance tuning rather than live monitoring.
Go deeper
Related to this question
Learn chapter
Optimizing Database Query and Index Performance
Key term
Azure SQL Performance Tuning
Azure SQL Performance Tuning is the process of optimizing the speed and efficiency of queries and database operations in Microsoft Azure SQL Database or SQL Managed Instance to reduce latency and improve throughput.
About these practice questions
Courseiva writes every DP-300 question from scratch — 574 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Microsoft exam blueprint
This DP-300 practice question is part of Courseiva's free Microsoft certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the DP-300 exam.