Jobs and Schedules
The CData Virtuality Server provides a mechanism for getting tasks automatically done. This mechanism consists of two parts: jobs and schedules. A job selects what has to be done, and a schedule defines when and how often it has to be done. To run a job, create and enable a schedule for it. Please remember that schedules are associated with a specific job and cannot be assigned to more than one job. You can also control job execution using job queues managed by job queue handlers.
There are different kinds of jobs:
- optimization jobs
- SQL jobs
- statistic jobs
- system jobs
There are also different types of schedules:
- once
- interval
- cron
- chained
The jobs can have the following execution statuses:
RUNNING
SUCCESS
FAILED
INTERRUPTED
(set when the job execution is cancelled or the underlying query is killed)FAILED_AUTORETRY
(set when the job has failed and is configured to retry automatically)NOT_STARTED
- set when- all base schedules and/or jobs for an atomic chained schedule are triggered, but some of these jobs finished with unsatisfactory results
- job is triggered, but disabled
- if a
QUEUED
job is disabled - job is triggered but hits the limit of parallel runs allowed for it
QUEUED
(set when the job is placed in the queue)
All jobs are stored in the SYSADMIN.ScheduleJobs
table and the schedules are kept in the SYSADMIN.Schedule
table.
Jobs statuses are logged to server.log
at the following levels:
Level | Statuses |
---|---|
ERROR |
|
WARNING | NOT STARTED |
INFO | SUCCESS |
Owner, runAs, and Permissions
Jobs and schedules have an owner
attribute. Jobs also have a runAs
attribute. Jobs are created with the current user as owner
and CALLER
as runAs
if not specified. Schedules are created with the current user as owner
if the owner
is not specified.
Jobs have permissions which can be set using SYSADMIN.SetPermissions
. Here is how the permissions work:
Permission | Description |
---|---|
READ | Allows users to see jobs |
DELETE | Allows users to delete jobs |
EXECUTE | Allows users to execute jobs. Allows users to create, edit and delete schedules for jobs. |
ALTER | Allows users to change jobs |
Please note that in order to run a job, users must have an E
permission for the following procedures: SYSADMIN.createSchedule
, SYSADMIN.enableSchedule
.
In order to change a job, users must have the following:
- An
A
permission for the job; - An
E
permission for the following procedures:SYSADMIN.changeSQLJob, SYSADMIN.changeJobParameters
.
Only admins can change the owner
of jobs and schedules, and only owners and admins can change jobs' runAs.
See Owner and Runner (Executor) of Jobs and Procedures for more details.
owner
, runAs
, and permissions for jobs are available since v4.1