Skip to content

Latest commit

 

History

History
63 lines (48 loc) · 4.25 KB

monitor-job-activity.md

File metadata and controls

63 lines (48 loc) · 4.25 KB
title description author ms.author ms.date ms.service ms.subservice ms.topic helpviewer_keywords monikerRange
Monitor Job Activity
Monitor Job Activity
markingmyname
maghan
01/19/2017
sql
ssms
how-to
SQL Server Agent, monitoring
jobs [SQL Server Agent], monitoring
monitoring [SQL Server], jobs
activity monitoring [SQL Server Agent]
monitoring [SQL Server], SQL Server Agent
monitoring [SQL Server Agent]
SQL Server Agent Job Activity Monitor
SQL Server Agent jobs, monitoring
performance [SQL Server], jobs
current activity
= azuresqldb-mi-current || >= sql-server-2016

Monitor Job Activity

[!INCLUDE SQL Server SQL MI]

Important

On Azure SQL Managed Instance, most, but not all SQL Server Agent features are currently supported. See Azure SQL Managed Instance T-SQL differences from SQL Server for details.

You can monitor the current activity of all defined jobs on an instance of [!INCLUDEssNoVersion] by using [!INCLUDEssNoVersion] Agent Job Activity Monitor.

SQL Server Agent Sessions

[!INCLUDEssNoVersion] Agent creates a new session each time the service starts. When a new session is created, the sysjobactivity table in the msdb database is populated with all the existing defined jobs. This table preserves the last activity for jobs when [!INCLUDEssNoVersion] Agent is restarted. Each session records [!INCLUDEssNoVersion] Agent normal job activity from the start of the job to its finish. Information about these sessions is stored in the syssessions table of the msdb database.

Job Activity Monitor

The Job Activity Monitor allows you to view the sysjobactivity table by using SQL Server Management Studio. You can view all jobs on the server, or you can define filters to limit the number of jobs displayed. You can also sort the job information by clicking on a column heading in the Agent Job Activity grid. For example, when you select the Last Run column heading, you can view the jobs in the order that they were last run. Clicking the column heading again toggles the jobs in ascending and descending order based on their last run date.

Using the Job Activity Monitor you can perform the following tasks:

  • Start and stop jobs.

  • View job properties.

  • View the history for a specific job.

  • Refresh the information in the Agent Job Activity grid manually or set an automatic refresh interval by clicking View refresh settings.

Use the Job Activity Monitor when you want to find out what jobs are scheduled to run, the last outcome of jobs that have run during the current session, and to find out which jobs are currently running or idle. If the [!INCLUDEssNoVersion] Agent service fails unexpectedly, you can determine which jobs were in the middle of being executed by looking at the previous session in the Job Activity Monitor.

To open the Job Activity Monitor, expand SQL Server Agent in [!INCLUDEssManStudio] Object Explorer, right-click Job Activity Monitor, and click View Job Activity.

You can also view job activity for the current session by using the stored procedure sp_help_jobactivity.

Related Tasks

Description Topic
Describes how to view the runtime state of [!INCLUDEssNoVersion] Agent jobs. View Job Activity

See Also

View Job Activity
sysjobactivity (Transact-SQL)
syssessions (Transact-SQL)
sp_help_jobactivity (Transact-SQL)