πŸ”’ Guided

Pre-launch preview. Authorised access only.

Incorrect code

Guided by A Guide to Cloud
Explore AB-900 AI-901
Guided DP-300 Domain 3
Domain 3 β€” Module 2 of 7 29%
13 of 28 overall

DP-300 Study Guide

Domain 1: Plan and Implement Data Platform Resources

  • Choose Your Azure SQL Platform Free
  • Deploy and Configure Azure SQL Free
  • Scale, Performance, and Compression Free
  • Migration Planning: Online vs Offline Free
  • Execute and Troubleshoot Migrations Free

Domain 2: Implement a Secure Environment

  • Entra Authentication for Azure SQL
  • Security Principals, Permissions, and T-SQL
  • Encryption: TDE, Always Encrypted, and VBS Enclaves
  • Network Security: Firewalls, Private Links, and Endpoints
  • Data Classification and Auditing
  • Data Masking, Ledger, and Row-Level Security

Domain 3: Monitor, Configure, and Optimize Database Resources

  • Performance Baselines and Monitoring Tools
  • Database Watcher and Extended Events
  • Query Store: Configure and Monitor
  • Blocking, DMVs, and Execution Plans
  • Index and Query Optimization
  • Database Maintenance: Indexes, Statistics, and Integrity
  • Automatic Tuning and Performance Settings

Domain 4: Configure and Manage Automation of Tasks

  • Automation Landscape: What Runs Where
  • SQL Server Agent Jobs
  • Deploy with ARM, Bicep, PowerShell, and CLI
  • Elastic Jobs and Azure Automation

Domain 5: Plan and Configure an HA/DR Environment

  • HA/DR Strategy: RPO, RTO, and Architecture
  • Backup and Restore: Strategy and Native Tools
  • Point-in-Time Restore, LTR, and Cloud Backup
  • Geo-Replication and Failover Groups
  • Always On: Availability Groups and FCIs
  • Log Shipping and HA/DR Operations

DP-300 Study Guide

Domain 1: Plan and Implement Data Platform Resources

  • Choose Your Azure SQL Platform Free
  • Deploy and Configure Azure SQL Free
  • Scale, Performance, and Compression Free
  • Migration Planning: Online vs Offline Free
  • Execute and Troubleshoot Migrations Free

Domain 2: Implement a Secure Environment

  • Entra Authentication for Azure SQL
  • Security Principals, Permissions, and T-SQL
  • Encryption: TDE, Always Encrypted, and VBS Enclaves
  • Network Security: Firewalls, Private Links, and Endpoints
  • Data Classification and Auditing
  • Data Masking, Ledger, and Row-Level Security

Domain 3: Monitor, Configure, and Optimize Database Resources

  • Performance Baselines and Monitoring Tools
  • Database Watcher and Extended Events
  • Query Store: Configure and Monitor
  • Blocking, DMVs, and Execution Plans
  • Index and Query Optimization
  • Database Maintenance: Indexes, Statistics, and Integrity
  • Automatic Tuning and Performance Settings

Domain 4: Configure and Manage Automation of Tasks

  • Automation Landscape: What Runs Where
  • SQL Server Agent Jobs
  • Deploy with ARM, Bicep, PowerShell, and CLI
  • Elastic Jobs and Azure Automation

Domain 5: Plan and Configure an HA/DR Environment

  • HA/DR Strategy: RPO, RTO, and Architecture
  • Backup and Restore: Strategy and Native Tools
  • Point-in-Time Restore, LTR, and Cloud Backup
  • Geo-Replication and Failover Groups
  • Always On: Availability Groups and FCIs
  • Log Shipping and HA/DR Operations
Domain 3: Monitor, Configure, and Optimize Database Resources Premium ⏱ ~12 min read

Database Watcher and Extended Events

Monitor Azure SQL with database watcher for trend analysis and Extended Events for deep diagnostics. Learn when to use each tool.

Two monitoring powerhouses

β˜• Simple explanation

Database watcher is like a fitness tracker for your database β€” it continuously monitors vitals (CPU, queries, waits) and shows trends over time on a dashboard. Great for seeing the big picture.

Extended Events is like a body scanner β€” you tell it exactly what to look for (specific queries, deadlocks, errors), and it captures detailed diagnostic data. Great for diagnosing specific problems.

Use watcher for β€œis my database healthy?” Use Extended Events for β€œwhy is this specific query slow?”

Database watcher is an Azure-native monitoring service for Azure SQL Database and Managed Instance. It collects performance data into an Azure Data Explorer (Kusto) datastore and provides pre-built dashboards.

Extended Events (XEvents) is SQL Server’s lightweight event-tracing framework. It replaces SQL Trace/Profiler with lower overhead and more flexibility. Available on all platforms.

Database watcher

What it monitors

  • Resource utilisation β€” CPU, memory, I/O, storage
  • Query performance β€” top queries by duration, CPU, logical reads
  • Wait statistics β€” what queries are waiting on
  • Session activity β€” active sessions, blocking
  • Index usage β€” missing indexes, unused indexes

How it works

  1. Create a watcher resource in the Azure portal
  2. Add targets β€” the SQL databases or Managed Instances to monitor
  3. Data flows to an Azure Data Explorer cluster or free cluster
  4. Pre-built Grafana-style dashboards in the Azure portal
  5. Write custom KQL queries for deep analysis

Key benefits

  • Low overhead β€” uses read-only DMV polling, minimal impact on production
  • Cross-database visibility β€” monitor multiple databases from one dashboard
  • Historical data β€” retains months of performance history (unlike 1-hour DMVs)
  • Alert integration β€” set up alerts based on collected metrics
ℹ️ Database watcher vs Azure Monitor

Both monitor Azure SQL, but they serve different purposes:

  • Azure Monitor β€” resource-level metrics (CPU %, DTU %, storage), alerts, and diagnostic logs
  • Database watcher β€” deeper SQL-specific metrics (query-level performance, wait stats, index analysis) with richer dashboards

Think of Azure Monitor as the basic dashboard and database watcher as the advanced analytics tool. They complement each other.

Extended Events (XEvents)

Extended Events is the diagnostic microscope of SQL Server β€” capture exactly the events you need with minimal overhead.

Architecture

ComponentPurpose
EventsWhat to capture (e.g., sql_statement_completed, deadlock_report)
PredicatesFilters β€” only capture events matching conditions
ActionsAdditional data to collect (e.g., sql_text, query_plan_hash)
TargetsWhere to store captured data (ring_buffer, event_file, histogram)
SessionA configured collection of events + predicates + actions + targets

Common XEvent sessions

-- Capture long-running queries (over 5 seconds)
CREATE EVENT SESSION LongQueries ON DATABASE
ADD EVENT sqlserver.sql_statement_completed (
    ACTION (sqlserver.sql_text, sqlserver.query_plan_hash)
    WHERE duration > 5000000  -- microseconds
)
ADD TARGET package0.ring_buffer
WITH (MAX_MEMORY = 4096 KB);

ALTER EVENT SESSION LongQueries ON DATABASE STATE = START;

-- Capture deadlocks
CREATE EVENT SESSION DeadlockCapture ON DATABASE
ADD EVENT sqlserver.xml_deadlock_report
ADD TARGET package0.ring_buffer;

ALTER EVENT SESSION DeadlockCapture ON DATABASE STATE = START;

Reading XEvent data

-- Read from ring buffer
SELECT
    event_data = CAST(target_data AS XML)
FROM sys.dm_xe_database_session_targets t
JOIN sys.dm_xe_database_sessions s ON t.event_session_address = s.address
WHERE s.name = 'LongQueries' AND t.target_name = 'ring_buffer';

Targets compared

TargetBest ForData Retention
ring_bufferQuick diagnostics, limited memoryIn memory only (lost on restart)
event_fileLong-term capture, large volumesPersisted to disk/blob storage
event_counterCounting occurrencesIn memory
histogramDistribution analysisIn memory
ℹ️ XEvents on Azure SQL Database

Azure SQL Database supports Extended Events with some differences from on-prem:

  • Use ON DATABASE instead of ON SERVER
  • event_file target stores to Azure Blob Storage (not local disk)
  • Some server-level events aren’t available
  • SSMS’s XEvent viewer and Azure Data Studio both support browsing captured events

When to use which

Database Watcher vs Extended Events
AspectDatabase WatcherExtended Events
PurposeContinuous monitoring and trend analysisTargeted diagnostic capture
SetupAzure Portal (managed)T-SQL or SSMS wizard
OverheadVery low (DMV polling)Low (but depends on events selected)
Data retentionMonths (Azure Data Explorer)Session lifetime or blob storage
Best forHealth dashboards, capacity planningDeadlock analysis, slow query tracing, specific event diagnosis
PlatformsSQL DB, MISQL DB, MI, SQL on VMs
Custom queriesKQL (Kusto)XQuery on XML event data
Question

What is the primary use case for database watcher?

Click or press Enter to reveal answer

Answer

Continuous, low-overhead monitoring of Azure SQL with pre-built dashboards. Shows trends in CPU, queries, waits, and index usage. Data stored in Azure Data Explorer for months of history.

Click to flip back

Question

What are the four main components of an Extended Events session?

Click or press Enter to reveal answer

Answer

Events (what to capture), Predicates (filter conditions), Actions (additional data to collect), and Targets (where to store: ring_buffer, event_file, histogram, etc.).

Click to flip back

Question

Where does the event_file target store data in Azure SQL Database?

Click or press Enter to reveal answer

Answer

Azure Blob Storage. Unlike on-prem SQL Server where files go to local disk, Azure SQL DB uses a Blob Storage container for event file targets.

Click to flip back

Knowledge Check

Tomas needs to investigate intermittent deadlocks that happen a few times per week. He needs to capture the full deadlock graph (victims, resources, queries) for analysis. What should he use?

Knowledge Check

Kenji wants a dashboard showing CPU trends, top queries, and wait statistics across all 15 of NorthStar's Azure SQL databases for the past 3 months. What should he set up?

🎬 Video coming soon

Next up: Query Store: Configure and Monitor β€” the built-in flight recorder for query performance.

← Previous

Performance Baselines and Monitoring Tools

Next β†’

Query Store: Configure and Monitor

Guided

I learn, I simplify, I share.

A Guide to Cloud YouTube Feedback

© 2026 Sutheesh. All rights reserved.

Guided is an independent study resource and is not affiliated with, endorsed by, or officially connected to Microsoft. Microsoft, Azure, and related trademarks are property of Microsoft Corporation. Always verify information against Microsoft Learn.