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:
RUNNINGSUCCESSFAILEDINTERRUPTED(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 whenall 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
QUEUEDjob is disabledjob 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 |
|---|---|
|
|
|
|
|
|
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 |
|---|---|
| Allows users to see jobs |
| Allows users to delete jobs |
| Allows users to execute jobs. Allows users to create, edit and delete schedules for jobs. |
| 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
Apermission for the job;An
Epermission 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