- 01What SQL Server monitoring should catch
- 02How to build SQL Server monitoring coverage
- 03How to set up SQL Server monitoring without expensive tools
- 04Built-in SQL Server monitoring tools
- 05When to use a central collector
- 06Test alert delivery
- 07What to monitor in SQL Server
- 08SQL Server monitoring alerts that need action
- 09SQL Server error log monitoring
- 10How to monitor SQL Server performance and blocking
- 11How to monitor SQL Server backups, jobs, and DBCC
- 12How to monitor SQL Server storage, tempdb, and capacity
- 13How to monitor SQL Server HA, DR, and failover
- 14How to build a SQL Server monitoring baseline
- 15What not to do with SQL Server monitoring
- 16When to request a SQL Server monitoring review
sql server hub / monitoring guide
SQL Server Monitoring Setup
Set up SQL Server monitoring by checking backup age, SQL Agent job outcomes, blocking, disk space and replica health. Use Database Mail for Agent notifications and collect an availability check outside the instance.
Start with the monitoring setup checklist and use the linked queries to collect and verify each check.
SQL Server monitoring setup checklist
- Check recovery and maintenance. Compare full and log backup age with the database's recovery requirements. Alert on failed and missed Agent jobs and record the last successful CHECKDB.
- Capture blocking and query history. Save the head blocker and wait information while the chain is active. Use Query Store where enabled and retain deadlock graphs from Extended Events.
- Track storage headroom. Sample free space on each volume, file growth and tempdb use. Set thresholds against observed growth and the time needed to add capacity.
- Check connectivity and replica health. Probe from outside the instance. For an availability group, also check each replica's synchronization state and the listener from the application network.
- Test alert delivery. Send a test notification to the on-call destination and confirm that it names the instance, database or job, the time, and the first action.
What SQL Server monitoring should catch
Uptime is only one check. A SQL Server can accept connections while backups are stale, DBCC has not run, jobs are failing, tempdb is filling, and blocking is already hurting users.
Good monitoring watches the work SQL Server depends on, not only whether the service is online. It should notice when recovery work is missing, when scheduled work is failing, when users are waiting, when storage is becoming the bottleneck, and when HA or DR state has changed.
Monitoring is not a dashboard by itself. It needs collection, retention, thresholds, alert routing, first checks, and someone responsible for response. The useful question is not just whether there is a graph, but whether the graph, alert, or history would help someone act before the problem becomes a user report.
| Monitoring area | What it should catch | Why it matters |
|---|---|---|
| Recovery | Missed backups, broken log backup patterns, stale restore testing, and missing backup alerts. | Backup history is not useful if nobody notices gaps until a restore is needed. |
| Maintenance | Failed jobs, stale CHECKDB, cleanup failures, long-running maintenance, and schedule overlap. | SQL Agent can look quiet while important work has stopped or drifted into business hours. |
| Workload | Blocking chains, deadlocks, high waits, slow queries, plan regressions, and Query Store changes. | Performance issues need timing, query text, plans, and session details, not only average CPU graphs. |
| Storage | File latency, free space, log growth, tempdb pressure, version-store growth, and abnormal file growth. | Storage pressure can appear as slow queries, blocking, failed backups, or database growth incidents. |
| Availability | AG replica health, synchronization state, listener problems, failover events, and DR jobs that stopped running. | HA and DR only help when the monitoring system sees role changes and broken dependencies. |
| Response | Alerts that are routed, acknowledged, repeated when needed, and tied to a first-check note. | A correct alert still fails if it goes to an abandoned mailbox or gives nobody enough context to start. |
How to build SQL Server monitoring coverage
Build the monitoring setup from production failures backward. Decide which failures must be caught, which SQL Server data source can show them, how often to collect it, how long to keep it, and who gets the alert.
The order matters: critical failures first, data sources second, collection method third, then retention, thresholds, alert routing, response notes, and a regular review cycle.
| Build step | What to decide | Why it matters |
|---|---|---|
| Failure list | Backups, jobs, DBCC, blocking, deadlocks, storage, tempdb, Query Store, HA, and error-log events. | Monitoring should catch failures that affect recovery, performance, or support work. |
| Data source | DMV, Query Store, Extended Events, SQL Agent history, msdb, error log, Performance Monitor, or vendor collector. | The source controls what can be trusted, retained, and alerted on. |
| Collection | Polling interval, collector location, permissions, repository, and retention. | A one-time query is useful, but it is not monitoring. |
| Alert rule | Threshold, delay, repeat behavior, severity, and suppression rules. | Bad thresholds create noise; weak thresholds miss incidents. |
| Response | First check, escalation path, and the person responsible for action. | An alert without a response path becomes another ignored email. |
| Review cycle | Monthly or quarterly alert review, false-positive cleanup, and missed-failure review. | The setup needs tuning as databases, jobs, workload, and HA topology change. |
Reads server identity, edition, startup time, CPU, memory, clustered state, and HADR state.
How to check SQL Server instance context
T-SQL · 16 lines
sqlserver_start_time tells you how long DMV counters have been accumulating. CPU and memory values give context for pressure checks. IsClustered and IsHadrEnabled show whether cluster or AG checks may apply. This query needs metadata access and may need VIEW SERVER STATE for DMV details.
How to set up SQL Server monitoring without expensive tools
You can set up useful SQL Server monitoring without buying a large monitoring platform first. Start with the checks SQL Server already gives you: SQL Agent history, Database Mail, operators, alerts, backup history, the error log, Query Store, Extended Events, and Performance Monitor.
The tradeoff is maintenance. A low-cost setup still needs alert routing, history retention, thresholds, a simple response note, and someone responsible for checking whether alerts still work.
This approach fits small environments where the first goal is to catch missed backups, failed SQL Agent jobs, serious errors, blocking, deadlocks, storage pressure, and query regressions. If the number of instances grows, a SQL-focused monitoring tool can become cheaper than maintaining custom checks by hand.
| Input | Use it for | Watch out |
|---|---|---|
| SQL Agent history | Failed jobs, long-running jobs, retried jobs, canceled steps, job owners, and recent run patterns. | History retention must be long enough to investigate missed failures. |
| Database Mail, operators, and Agent alerts | Job failure emails, severity alerts, performance alerts, and the people or groups receiving them. | Mail setup and operator addresses need testing; an alert that cannot send is decoration. |
| msdb backup history | Last full, differential, and log backup by database, plus gaps in expected backup chains. | Backup history shows job output, but restore testing still needs its own check. |
| SQL Server error log and Windows Application log | Severity errors, login bursts, I/O messages, service restarts, AG messages, and backup errors. | Logs are noisy, so filters and a review rhythm matter. |
| Query Store | Query runtime history, plan changes, regressions, and release comparisons in each database where it is enabled. | It needs database-level setup, retention decisions, and review before changes. |
| Extended Events | Deadlocks, blocked-process reports, login failures, and targeted query or error capture. | Keep sessions focused and test collection overhead before broad rollout. |
| Performance Monitor | CPU, memory, disk, SQL Server counters, and simple threshold alerts. | Counters need sampling and local baselines; one snapshot rarely explains an incident. |
| Existing infrastructure monitoring | Service status, disk free space, VM health, storage latency symptoms, and basic host alerts. | It still needs SQL-specific checks for jobs, backups, waits, blocking, and Query Store. |
Built-in SQL Server monitoring tools
SQL Server already exposes useful monitoring data through DMVs, Query Store, Extended Events, SQL Agent history, msdb backup tables, the SQL Server error log, and Performance Monitor counters.
Performance Monitor is still useful when SQL Server and Windows counters need to be read together. Keep it focused; collecting too many counters adds overhead. Extended Events is the modern lightweight event framework for deadlocks, blocked-process reports, long queries, and targeted troubleshooting.
| Tool model | Use it for |
|---|---|
| DMVs | Current requests, waits, file latency, memory, schedulers, sessions, and AG state. |
| Query Store | Query runtime history, plans, regressions, and release or upgrade comparisons. |
| Extended Events | Deadlocks, blocked-process reports, expensive statements, login failures, and targeted event capture. |
| SQL Agent and Database Mail | Job scheduling, job history, operators, alerts, and email delivery. |
| msdb history | Backups, restores, SQL Agent job output, maintenance jobs, and some CHECKDB history if jobs log it. |
| SQL Server error log | Severity errors, startup messages, backup problems, login problems, AG messages, and failed service-level events. |
| Performance Monitor | Windows and SQL counters together: CPU, memory, disk I/O, buffer manager, and workload rate. |
| Custom SQL Agent or PowerShell checks | Targeted backup, job, DBCC, file, blocking, or capacity checks missing from the main tool. |
When to use a central collector
Collect outside the monitored instance when a SQL Server outage could stop its own checks. For a shared monitoring server, record the most recent successful collection per instance. Alert on stale data so a collector or credential failure is visible.
If you need fleet-wide alert routing or longer query history, see the SQL Server monitoring software comparison for coverage and trial checks.
Test alert delivery
- On a test instance, set up a disposable Agent job that fails and sends an operator notification on failure.
- Run the job and confirm the failure in Agent history, then confirm delivery to the mailbox or incident queue used by the on-call person. On editions without Agent, run the equivalent test through the external scheduler.
- Check that a missed run can raise its own alert. Compare the last completed run with the expected schedule so a disabled job or stopped Agent is visible.
- Test the external connectivity check separately. A SQL Server outage can also prevent local Database Mail delivery.
What to monitor in SQL Server
A useful SQL Server monitoring setup checks recovery, workload, storage, maintenance, and topology together. CPU and memory are not enough.
| Area | Monitor |
|---|---|
| Availability | Instance up, database state, application connection failures, SQL Server error log, service restarts, and recent failovers. |
| Recovery | Full, differential, and log backup age; backup failures; restore test age; restore job output; and log-chain gaps. |
| Maintenance | SQL Agent failures, long-running jobs, stale CHECKDB, index/statistics jobs, cleanup jobs, and Database Mail failures. |
| Performance | Waits, active requests, blocking, deadlocks, Query Store regressions, CPU, memory, worker pressure, and batch rate. |
| Storage | Free space, file growth, log growth, I/O latency, disk queues, backup throughput, and data/log placement. |
| tempdb | File sizes, growth, free space, internal objects, user objects, version store, spills, and contention symptoms. |
| HA and DR | AG synchronization, redo/log send queues, replica health, backup preference, failover readiness, jobs on each replica, and listener behavior. |
| Security-relevant changes | Failed login bursts, new sysadmins, changed service accounts, changed Agent proxies, and audit or compliance job failures where used. |
SQL Server monitoring alerts that need action
Alerts should be routed by production impact and first action. Do not page people for informational events they cannot change.
Each alert needs a threshold, delay, repeat rule, responsible person, first check, and escalation route. Otherwise it becomes background noise.
| Alert | First check |
|---|---|
| Backup is stale or failed | msdb backup history, job output, storage path, backup target, and recent database state. |
| SQL Agent job failed | Failed step, job owner, proxy or credential, command path, job duration, and last successful run. |
| DBCC CHECKDB is stale | Maintenance job history, database list, runtime window, output table or log file, and last known success. |
| Blocking is above threshold | Head blocker, running statement, transaction age, wait resource, login, host, and application. |
| Deadlock burst | Deadlock graph, application path, object/index names, isolation level, retry behavior, and release timing. |
| Data or log file is low on space | Growth setting, drive free space, log reuse wait, recent bulk work, and backup/log backup state. |
| AG replica is unhealthy | Synchronization state, queues, replica connection, failover mode, backup preference, and listener state. |
| High file latency | Affected files, read/write split, storage path, workload timing, backup activity, and VM/storage events. |
SQL Server error log monitoring
SQL Server error log monitoring should catch serious engine messages, failed service starts, I/O warnings, corruption messages, login bursts, backup and restore errors, Always On state changes, and repeated restart patterns.
The log is noisy, so monitor it with filters and a review rhythm. Treat new severity 17-25 errors, 823/824/825 I/O messages, failed recovery messages, login failures, and AG state changes as reasons to check the surrounding jobs, storage, backups, and Windows Application log.
If you need to collect the log across several instances, compare SQL Server error log monitoring tools and test that entries arrive across rotation.
| Log pattern | First check |
|---|---|
| Severity 17-25 errors | Error number, database, time window, recent workload, storage state, and whether the error repeats. |
| 823, 824, or 825 messages | Storage path, Windows logs, backups, CHECKDB output, and vendor/storage events. |
| Recovery or restore messages | Database state, restore sequence, startup timing, crash recovery, and recent failover or restart. |
| Login failures | Source host, login name, application, password changes, failed-login bursts, and security review path. |
| Always On messages | Replica role, synchronization health, listener state, cluster log, failover timing, and AG alerts. |
Reads recent SQL Server error log entries containing Error: from the current error log.
How to sample SQL Server error log errors
T-SQL · 1 lines
xp_readerrorlog is useful for targeted review, but the output needs filtering. Search for specific error numbers such as 823, 824, 825, 9002, 1205, or AG messages when the symptom is known. Pair SQL Server error log review with Windows Application and System logs for service, disk, and cluster events. Do not build alerting from one broad text search without noise tuning.
How to monitor SQL Server performance and blocking
Monitoring should capture waits, active requests, blockers, query text, reads, writes, CPU, and duration while the issue is happening. After the incident, the useful details are usually gone unless the tool captured them.
Lists top cumulative waits while excluding common background waits.
How to read SQL Server wait stats
T-SQL · 18 lines
wait_seconds helps identify the largest cumulative waits since startup. signal_wait_time_ms can point toward scheduler pressure. High wait totals need workload timing and baseline context. Do not reset wait stats casually in production. Recent SQL Server versions can require VIEW SERVER PERFORMANCE STATE for some performance DMVs.
Shows sessions waiting right now, including wait type, duration, blocking session, resource, command, and database.
How to capture current waiting tasks
T-SQL · 18 lines
wait_duration_ms shows which waits are active long enough to matter. blocking_session_id points to live blocking when the value is not zero. resource_description can identify locks, pages, latches, or other resources. Use this with active requests before changing server settings.
Shows current requests with blocking session, wait details, resource use, database, and running statement.
How to capture active requests and blockers
T-SQL · 32 lines
blocking_session_id identifies live blocking chains. wait_type and wait_resource show what the request is waiting on right now. logical_reads, reads, writes, and cpu_time help prioritize active work. Use the blocking guide when blocking is active and the chain needs deeper review.
Run inside a user database with Query Store enabled to find recent high-duration or high-read queries.
How to find Query Store workload candidates
T-SQL · 21 lines
This query is a candidate list, not a full before-and-after comparison. Capture a baseline window before releases, upgrades, or major maintenance. Compare the same workload window after the change: duration, CPU, reads, executions, and plans. Use Query Store output with waits, plans, and release timing. Query Store queries need database access and Query Store enabled in the user database.
How to monitor SQL Server backups, jobs, and DBCC
Monitoring that misses backups, restores, DBCC, and SQL Agent jobs is incomplete. The application can still work while the recovery path is already broken or scheduled work has stopped.
SQL Agent job monitoring should catch more than a red failed-job icon. It should show failed steps, retries, long runs, disabled schedules, missed expected runs, job history retention, notification settings, and whether Database Mail and operators can actually reach someone.
| SQL Agent check | What to verify |
|---|---|
| Failed jobs | Check failed job steps, step output, error message, owner, proxy, credential, command path, and last successful run. |
| Long-running jobs | Compare current duration with normal duration for the same schedule window before treating it as an incident. |
| Disabled jobs or schedules | Review disabled jobs, disabled schedules, job owners, and whether the disabled state is documented. |
| Missed expected runs | Compare schedules with recent job history so a job that never started does not look healthy. |
| Job history retention | Keep enough msdb job history to review incidents, month-end work, and recurring failures. |
| Notifications | Test Database Mail, operators, job notification settings, SQL Agent alert system settings, and the mailbox people actually read. |
| Output detail | Store job-step output where possible so the alert leads to the failing command, file path, package, or stored procedure. |
| Response path | Write down who checks the job first, what they check, and when the problem escalates. |
Reads msdb backup history to show recent backup coverage by backup type.
How to check backup monitoring coverage
T-SQL · 22 lines
last_full_backup is the base recovery input. last_log_backup matters for databases in full or bulk-logged recovery model. A missing backup date needs review before trusting the monitoring setup. Backup history does not replace restore testing. The msdb backup tables require access to msdb history.
Reads recent SQL Agent history for failed, retrying, canceled, in-progress, or long-running job steps.
How to check SQL Agent failures
T-SQL · 23 lines
run_status identifies failed, retrying, canceled, and in-progress work. duration_seconds helps catch jobs that now exceed the normal window. job_owner should be valid and intentional. Also check job steps, proxies, credentials, operators, alerts, Database Mail, CmdExec, PowerShell, SSIS, and output files.
Looks for DBCC CHECKDB mentions in SQL Agent history. Use this as a starting point, not a complete integrity-check audit.
How to find stale CHECKDB monitoring
T-SQL · 16 lines
This depends on job history text and job retention, so it can miss custom logging. A better setup stores CHECKDB output in a table or log path with alerting. Monitor both stale CHECKDB and failed CHECKDB. Use the backup guide when restore testing and CHECKDB coverage need deeper review.
How to monitor SQL Server storage, tempdb, and capacity
Free space is not enough. Storage monitoring needs file latency, growth behavior, log growth, data and log placement, backup throughput, tempdb space use, version store, internal objects, and capacity trend.
Reads database file paths, sizes, reads/writes, and average I/O stall from sys.dm_io_virtual_file_stats.
How to check database file latency
T-SQL · 14 lines
physical_name shows where data and log files live. avg_read_ms and avg_write_ms are starting points for storage review. Log files with high write latency need separate attention. Compare this with workload timing before blaming storage. File latency DMVs usually require server-level performance permissions.
Run in tempdb to review file sizes, free space, user objects, internal objects, version store, and growth settings.
How to check tempdb usage
T-SQL · 20 lines
version_store_mb matters when row versioning or long transactions are active. internal_object_mb can rise with sorts, hashes, spools, and spills. growth_setting should be predictable and large enough for production use. Use the tempdb guide when pressure keeps returning.
How to monitor SQL Server HA, DR, and failover
HA monitoring should check whether failover can actually work. Replica health, synchronization state, queues, backup preference, jobs, listener behavior, and failover drill output all matter.
Shows AG primary, replica mode, failover mode, connection state, synchronization health, and queue size.
How to check Availability Group monitoring inputs
T-SQL · 25 lines
primary_replica and role_desc show the current AG layout. availability_mode_desc and failover_mode_desc show configured behavior. synchronization_state_desc and queue sizes need attention before relying on failover. No AG rows means this check does not apply to that instance.
Reads recent SQL Server error log entries containing Error:. Filter further for AG, backup, login, memory, I/O, or severity patterns.
How to read recent SQL Server error log entries
T-SQL · 1 lines
The error log is noisy, but it catches service-level problems other queries can miss. Monitor severity errors, login bursts, AG messages, backup failures, memory errors, I/O errors, and restart messages. Use targeted filters or Extended Events for recurring patterns. Some environments restrict xp_readerrorlog; use approved logging access where required.
How to build a SQL Server monitoring baseline
A threshold only makes sense when it is compared with normal behavior. Build baseline windows before deciding what should page someone.
Capture normal business hours, batch windows, month-end or reporting work, maintenance windows, and the period after releases, storage changes, VM changes, SQL patches, or compatibility-level changes.
Reads common SQL Server counters that can seed monitoring baselines. This is a starting point, not complete monitoring.
How to collect baseline performance counters
T-SQL · 18 lines
Batch Requests/sec is workload rate, not health by itself. Page life expectancy needs local baseline context and memory size context. Some per-second counters are cumulative and need interval sampling. Use this with job schedules and business timing before setting thresholds.
| Baseline window | Why it matters |
|---|---|
| Business hours | Shows normal user workload, concurrency, waits, and request volume. |
| Batch windows | Separates expected job pressure from unexpected production pressure. |
| Month-end or reporting | Prevents heavy but expected workload from looking like an incident. |
| Maintenance windows | Keeps backup, CHECKDB, index, statistics, and cleanup pressure separate from user workload. |
| After releases or changes | Helps catch changed query shape, job timing, resource use, or alert noise. |
What not to do with SQL Server monitoring
Do not monitor only CPU, memory, and disk free space.
Do not buy a monitoring tool and leave alerts without a response path.
Do not alert on every transient wait or one-off CPU spike.
Do not ignore backups, jobs, DBCC, and error logs because the application is online.
Do not copy thresholds from another server without checking the local workload.
Do not give monitoring logins more permissions than they need.
Do not rely on screenshots when history and retention are needed.
Do not treat a green dashboard as restore, failover, or performance validation.
When to request a SQL Server monitoring review
A monitoring review makes sense when alerts are noisy, failures are missed, or incidents do not leave enough history to explain what happened.
Start with the SQL Server version, instance count, current monitoring tool, and the failures or alerts that made you question the setup. That is enough for a first look.
Next step
Use the Query Store guide to monitor collection state and preserve useful query history before the next regression.
Use the SQL Server health audit when monitoring is one part of a wider SQL Server check.
Use the SQL Agent job-failure guide when job status, output, execution identity and missed-run alerts disagree.
Use monthly SQL Server DBA support when backups, jobs, alerts, performance checks, and planned changes need regular attention.
Next useful reads: the SQL Server backup tools comparison, the SSMS alternatives comparison, the SQL Server backup guide, the SQL Server blocking guide, the SQL Server waits guide, the SQL Server failover guide, and the SQL Server tempdb guide.
