Skip to content

SQL Server Job Status

1. Detailed MetricsSQL Server

UID: sql_server_job_statusVersion: 1.3.1 Panels: ~14 Datasource: MSSQL

Purpose

This dashboard provides complete visibility of SQL Server Agent Job executions, including:

  • Failed, cancelled, and long-running jobs
  • Currently running jobs
  • Historical execution data to identify trends
  • Performance deviations and recurring issues

SQL Server Agent is the integrated task scheduling component in SQL Server that allows automating administrative tasks, database maintenance, and critical business processes. For more information, see the official SQL Server Agent documentation.

Variables

VariableDescription
$Server_NameSQL Server to monitor
$JobSpecific job or multiple jobs to filter

Color Code

ColorCodeMeaning
Green#00db88Success - Successful execution
Magenta#ad21d8e8To Check - Review
Red#F2495CFailed - Failed execution
Yellow#FFFF00Running - In execution
Orange#FF780ACancelled - Cancelled

Panels

Running Jobs

Running Jobs logs

Jobs currently in execution.

Importance: Knowing the running jobs is fundamental to avoid resource conflicts. Multiple jobs running simultaneously can compete for CPU, memory, and I/O, degrading the overall server performance. It also helps identify jobs that should have finished but are still active.


Running Jobs Exceeding Duration

Jobs Exceed Normal Duration logs

Running jobs that exceed their usual duration.

Importance: A job that exceeds its normal duration is an early warning sign of underlying problems. It can indicate locks, resource contention, unexpected data growth, or performance degradation. Detecting these anomalies quickly allows intervention before they affect other processes or users.

Long-running jobs

A job exceeding its normal duration may indicate:

  • Database locks
  • Unexpected data growth
  • Underlying performance issues

Job Executions Summary

Job Executions stat

Execution summary in the selected period.

Displayed metrics:

  • Successful Executions: Number of successfully executed jobs
  • Failed Executions: Number of failed jobs
  • Cancelled Steps: Number of cancelled steps
  • Failed Steps: Number of failed steps

Importance: This summary provides a quick view of operational health. Failed jobs can mean incomplete backups, broken ETL, or unexecuted maintenance. Each failure has potential impact on data integrity, business SLAs, or regulatory compliance.

Thresholds:

MetricValueColor
Failed Executions>= 1Red
Cancelled Steps>= 1Magenta
Failed Steps>= 1Magenta

Jobs Enabled/Disabled

Jobs Enabled stat

Number of enabled jobs on the server.

Importance: Monitoring the number of enabled jobs helps detect unauthorized configuration changes. An accidentally disabled job can result in unperformed backups, unprocessed data, or unregenerated reports.


Jobs Disabled stat

Number of disabled jobs on the server.

Importance: Disabled jobs should be reviewed periodically. They may be obsolete jobs that should be deleted, or critical jobs temporarily disabled that were never reactivated. Maintaining a clean inventory improves system maintainability.


Job History Table

Job History table

Job execution history in the selected time period.

Columns:

  • Job Name
  • Step
  • Status
  • Execution Date
  • Duration

Importance: Detailed history allows analyzing trends, identifying recurring failure patterns, and establishing normal duration baselines. It is essential for audits and for demonstrating SLA compliance.

Status mapping:

StatusColor
SuccessGreen
RunningYellow
CancelledOrange
FailedRed

Usually Failed Jobs

Usually Failed Jobs table

Jobs that fail frequently (recurring failure pattern).

Importance: Jobs with recurring failures represent technical debt that must be addressed. Each failure consumes administration time, generates unnecessary alerts (alert fatigue), and can mask more serious problems. Resolving these jobs improves overall system reliability.

Recurring failing jobs

Jobs that fail consistently must be investigated immediately. They may indicate:

  • Incorrect configuration
  • Insufficient permissions
  • Broken dependencies
  • Connectivity issues

Success vs Failed Chart

Success vs Failed timeseries

Chart of successful vs failed execution evolution.

Importance: Temporal visualization allows identifying correlations between failures and specific events (deployments, configuration changes, load peaks). It also helps detect gradual system degradation before it becomes a critical problem.


Interpretation Guide

Investigation Priorities

SituationPriorityAction
Failed jobHighReview error logs immediately
Job exceeds durationMediumInvestigate locks and performance
Cancelled jobMediumDetermine if intentional
Failure patternHighRoot cause analysis

Key Metrics

KPITargetInterpretation
Success Rate> 99%Operations stability
Failed Executions0Each failure requires investigation
Duration Exceeded0No blocked jobs

Views Used

ViewDescription
[JobStatus].[vwRunningJobs]Currently running jobs
[JobStatus].[vwRunningExceedDuration]Jobs exceeding normal duration
[JobStatus].[vwCountStatus]Execution status count
[JobStatus].vwJobsEnabledNumber of enabled jobs
[JobStatus].[vwJobsDisabled]Number of disabled jobs

Best Practices for SQL Server Agent Jobs

Job Configuration

  • Document the purpose: Each job should have a clear description of its function and owner
  • Appropriate category: Assigning jobs to logical categories facilitates administration and filtering
  • Execution account: Use service accounts with minimum necessary privileges (least privilege principle)
  • Coherent scheduling: Avoid overlapping jobs that compete for the same resources
  • Timeouts: Configure reasonable time limits to avoid jobs running indefinitely

Notification Configuration

  • Notify on failures: Configure email or event alerts for critical job failures
  • Defined operators: Keep operators updated with valid email addresses
  • Escalate appropriately: Configure escalated notifications for repeated failures
  • Avoid over-notification: Don't notify routine successes to prevent alert fatigue

Error Handling

  • Failure action: Define whether the job should continue or stop when a step fails
  • Automatic retries: Configure retries for transient errors (connectivity, locks)
  • Retry interval: Space out retries to allow system recovery
  • Detailed logging: Enable sufficient logging for diagnostics without impacting performance

Job Maintenance

  • Periodic review: Audit jobs monthly to remove obsolete ones
  • Credential updates: Rotate service account passwords according to policies
  • Post-change testing: Validate jobs after SQL Server updates or schema changes
  • Version control: Document changes to critical jobs with date and responsible party

Troubleshooting Strategies

Failed Job

  1. Review the error message in the job history (Job Activity Monitor or msdb.dbo.sysjobhistory)
  2. Verify permissions of the service account on all accessed resources
  3. Check connectivity if the job accesses external resources (linked servers, network files)
  4. Review disk space if it involves file writing or backups
  5. Verify dependent service status (SQL Server Agent, external services)
  6. Review recent changes on the server or affected database

Job with Exceeded Duration

  1. Verify active locks using sp_who2 or sys.dm_exec_requests
  2. Review the execution plan to identify costly operations
  3. Check statistics and index fragmentation on involved tables
  4. Analyze data growth since last normal execution
  5. Verify server resources (CPU, memory, I/O) during execution
  6. Compare with previous executions to identify behavior changes

Unexpectedly Cancelled Job

  1. Review who cancelled the job (SQL Server Error Log, Event Viewer)
  2. Verify if there was a restart of the SQL Server Agent service
  3. Check failover in high availability environments (Always On, Clustering)
  4. Review timeout policies configured in the job
  5. Verify maintenance scripts that might cancel jobs

Jobs with Recurring Failures

  1. Identify pattern: same error, same time, same day of week
  2. Correlate with events: backups, reindexing, usage peaks
  3. Review dependencies: stored procedures, linked servers, files
  4. Analyze historical logs to find when the problem started
  5. Test in controlled environment if the error can be reproduced
  6. Escalate to development if the problem is in the job code

Microsoft References

To delve deeper into SQL Server Agent administration and troubleshooting, consult the official documentation: