QUERY JOB (Query a job)

Use this command to display information about one or more jobs. The information can include job IDs and statuses. You can query jobs after starting a copy, tearing, or replication storage rule. Additionally, you can query retention set jobs, including jobs for copying a retention set to tape storage. You can filter the list of jobs that are displayed by specifying a job ID or other job attributes.

Privilege class

Any administrator can issue this command.

Syntax

Read syntax diagramSkip visual syntax diagram Query JOB job_idPEERid=peer_job_idSTatus=ANyStatus=ANyRunningCompletedInterruptedSleepingTerminatedBEGINDate=earliest_dateBEGINDate=dateBEGINTime=00:00:00BEGINTime=timeENDDate=TODAYENDDate=dateENDTime=NOWENDTime=time

Parameters

job_id
Specifies the ID of the job to query. The job ID is a unique number that is automatically assigned when the job starts. If you specify a job ID, only that job is considered during query processing and you do not have to specify other parameters. This parameter is optional.
Tip: To determine the ID of a job, issue the QUERY JOB command without specifying other parameters. Job IDs are included in the output, along with the associated job names. When a storage rule starts or a retention set is created, a message that includes the job number is also displayed in the activity log.
PEERid
Specifies the ID of the corresponding job on the partner server, which can be a source replication server or a target replication server. This parameter is optional. This parameter is used only for replication storage rule jobs.
Status
Specifies the status of a job. Only jobs that match the specified status are displayed. If you do not specify a status, jobs with all statuses are displayed. This parameter is optional. You can specify one of the following values:
ANy
Displays all jobs. This is the default value.
Running
Displays all jobs that are running. When a job starts running, the job status is automatically set to RUNNING and a timestamp that indicates the starting run time for the job is stored in the database. If you specify STATUS=RUNNING, all jobs with a status of RUNNING, INTERRUPTING, or TERMINATING are displayed.
Tip: If you run the INTERRUPT JOB command on a running job, the job is running with a status of INTERRUPTING. If you run the TERMINATE JOB command on a running job, the job is running with a status of TERMINATING. When a job stops running, active processes stop and the job information is updated with an end time and status.
Completed
Displays all jobs that were completed successfully without errors.
Interrupted
Displays all jobs that were interrupted because of an error or because the INTERRUPT JOB command was issued. When a job has a status of INTERRUPTED, the ENDDATE and ENDTIME values are blank in the job output because the job was not completed.
Sleeping
Displays all copy-to-tape jobs that are in a SLEEPING state. When a job does not finish copying a retention set or other data to tape during the allotted time, the job is in a SLEEPING state. A job remains in a SLEEPING state until the storage rule starts the copy-to-tape operation again.
Terminated
Displays all copy-to-tape jobs that were terminated by the server or by an administrator who issued the TERMINATE JOB command. A terminated job cannot be restarted.
BEGINDate
Specifies the beginning date in a range of job dates. Jobs that were started from this date are displayed. The default value is the earliest possible date on which the first job was started. If you specify a time but do not specify a beginning date, the earliest possible date is used. If you do not specify either a beginning date or time, all jobs from the earliest possible date to the current time are queried. This parameter is optional.
You can specify the date by using one of the following values:
Value Description Example
MM/DD/YYYY A specific date 05/15/2018
TODAY The current date TODAY
TODAY+days or +days The current date plus the number of specified days TODAY+3 or +3
TODAY-days or -days The current date minus the number of specified days TODAY-3 or -3
EOLM (End Of Last Month) The last day of the previous month EOLM
EOLM-days The last day of the previous month minus the number of specified days EOLM-1

To include jobs that were started a day before the last day of the previous month

BOTM (Beginning Of This Month) The first day of the current month BOTM
BOTM+days The first day of the current month, plus the number of specified days BOTM+9

To include jobs that were started on the 10th day of the current month

BEGINTime
Specifies the beginning time in a range of job times. Jobs that were started from this time are displayed. This parameter is optional. The default value is 00:00:00.
You can specify the time by using one of the following values:
Value Description Example
HH:MM:SS A specific time 15:30:08
NOW The current time NOW
NOW+HH:MM or +HH:MM The current time plus the specified number of hours and minutes NOW+02:00 or +02:00
NOW-HH:MM or -HH:MM The current time minus the specified number of hours and minutes NOW-02:00 or –02:00
ENDDate
Specifies the ending date in a range of job dates. Jobs that ended up to and including this date are displayed. This parameter is optional. The default is today's date.
You can specify the date by using one of the following values:
Value Description Example
MM/DD/YYYY A specific date. 05/15/2018
TODAY The current date. TODAY
TODAY+days or +days The current date plus the number of specified days. The maximum number of days that you can specify is 9999. TODAY+3 or +3
TODAY-days or -days The current date minus the number of specified days. TODAY-3 or -3
EOLM (End Of Last Month) The last day of the previous month. EOLM
EOLM-days The last day of the previous month minus the number of specified days. EOLM-1

To include jobs that ended a day before the last day of the previous month

BOTM (Beginning Of This Month) The first day of the current month. BOTM
BOTM+days The first day of the current month, plus the number of specified days. BOTM+9

To include jobs that ended on the 10th day of the current month

ENDTime
Specifies the ending time of the range of job times. Jobs that ended up to and including this time are displayed. This parameter is optional. The default value is the current time.
You can specify the time by using one of the following values:
Value Description Example
HH:MM:SS A specific time 15:30:08
NOW The current time NOW
NOW+HH:MM or +HH:MM The current time plus the specified number of hours and minutes NOW+02:00 or +02:00
NOW-HH:MM or -HH:MM The current time minus the specified number of hours and minutes NOW-02:00 or –02:00

Example: Display information about all jobs

Display information about all jobs. See Field descriptions for field descriptions.
query job
Job ID    Peer Job ID   Job Type    Job Name      Begin Date/Time        End Date/Time         Run Date/Time          Status    
-------   -----------   --------    ----------    -------------------    -------------------   -------------------    ---------
35                      RetSet      YEARLY        05/07/2018 08:41:48    05/07/2018 08:41:49                          Completed
36                      RetSet      QUARTERLY     05/07/2018 08:44:48    05/07/2018 08:44:49                          Completed
37                      RetSet      QUARTERLY     05/07/2018 08:45:18    05/07/2018 08:45:19                          Completed
42                      RuleCopy    COPYRULE1     05/13/2018 22:18:46    05/13/2018 22:18:47                          Completed
46                      RetSet      WEEKLY        05/14/2018 08:44:50    05/14/2018 08:44:52                          Completed
47                      RuleTier    TIERRULE3     05/14/2018 08:45:20    05/14/2018 08:45:22                          Completed
82                      RuleCopy    COPYRULE2     05/21/2018 17:09:25    05/21/2018 17:09:26                          Completed
91                      RuleCopy    COPYRULE3     05/25/2018 07:00:14    05/25/2018 07:00:18                          Completed
93                      RetSet      WEEKLY        05/25/2018 13:00:19    05/25/2018 13:00:22                          Completed
241       531           RuleRepl    REPLRULE      12/21/2021 17:34:09                          12/21/2021 18:34:09    Running	

Example: Display information about all running jobs

Display information about all jobs that are currently running. This includes all jobs that are in RUNNING, INTERRUPTING, or TERMINATING states. See Field descriptions for field descriptions.
query job status=running
Job ID   Peer Job ID  Job Type   Job Name      Begin Date/Time       End Date/Time         Run Date/Time          Status
-------  -----------  --------   ----------    -------------------   -------------------   --------------------   --------
210                   RetSet     YEARLY        10/14/2019 08:30:19                         10/15/2019 09:44:51    Running
211                   RuleTier   TIERRULE3     10/14/2019 08:35:27                                                Running
213                   RetSet     WEEKLY        10/14/2019 08:39:22                         10/15/2019 08:40:17    Running
243      541          RuleRepl   REPLRULE      12/21/2021 17:34:09                         12/21/2021 18:34:09    Running

Example: Display information about a job and its peer job

Display information about a replication job with job ID 531 and its peer job, with ID 241. See Field descriptions for field descriptions.

The following job output is from the source replication server.

query job 531 peerid=241
Job ID    Peer Job ID   Job Type   Job Name     Begin Date/Time     End Date/Time        Run Date/Time         Status
-------   -----------   --------   ----------   -----------------   -----------------    -------------------   ---------
531       241           RuleRepl   REPLPHX      12/21/21 18:02:30   12/21/21 18:03:51                          Completed

The following job output is from the corresponding target replication server.

>phoenix-dr: query job 241 peerid=531
Job ID   Peer Job ID   Job Type   Job Name     Begin Date/Time      End Date/Time        Run Date/Time         Status
-------  -----------   --------   ----------   -------------------  -------------------  -------------------   ---------
241      531           RuleRepl   (Inbound)    12/21/21 18:02:30    12/21/21 18:04:00                          Completed
                                  REPLPHX
				  from
			          PRIMARY

Field descriptions

Job ID
The unique numeric ID that is associated with the job.
Peer Job ID
The job ID of the corresponding replication job on the partner server.
Job Type
The type of job. The following job types are possible:
RetSet
Specifies a retention set creation job.
RuleCopy
Specifies that the job was created by starting a copy storage rule.
RuleTier
Specifies that the job was created by starting a tiering storage rule.
RuleRepl
Specifies that the job was created by starting a replication storage rule.
Job Name
The name of the job. For retention set creation jobs, the job name is the name of the retention rule that is used to create the retention set. For tearing, copy, and replication storage rule jobs, the job name is the name of the storage rule.
If the QUERY JOB command is issued on the target replication server, the Job Name field displays a value of (Inbound), followed by the names of the storage rule and the source replication server.
In the Example, under the Job Name field, REPLPHX is the storage rule name and PRIMARY is the source replication server name.
Begin Date/Time
The date and time when the job was started.
End Date/Time
The date and time when the job ended.
Run Date/Time
The most recent date and time when the retention set creation job started running. This value is blank when all processes that are associated with the job stop. For retention set creation jobs, the Run Date/Time field value might differ from the Begin Date/Time value if the retention set creation job was interrupted and resumed.
Restriction: This field applies only to retention set jobs. For storage rule jobs, the Run Date/Time field is blank.
Status
The status of the job.
Tip: To view jobs with a status of INTERRUPTING or TERMINATING, you must specify STATUS=RUNNING in the query. With this filter, all jobs with a status of RUNNING, INTERRUPTING, and TERMINATING are displayed.

Related commands

Table 1. Commands related to QUERY JOB
Command Description
INTERRUPT JOB Interrupts a job in a running state.
RESUME JOB Resumes an interrupted job.
TERMINATE JOB Terminates a job in an interrupted or sleeping state.