Managing Jobs
Changing Job Parameters
Depending on the job type (SQL job or some other job), the corresponding stored procedure can be used to change the job parameters:
SYSADMIN.changeSQLJob(IN jobid biginteger, IN script string NOT NULL, IN description string, IN parallelRunsAllowed integer, IN retryCounter integer, IN retryDelay integer, IN runTimeout integer, IN jobUuid string)
SYSADMIN.changeJobParameters(IN jobid biginteger, IN parallelRunsAllowed integer, IN retryCounter integer, IN retryDelay integer, IN runTimeout integer, IN owner string, IN runAs string, IN jobUuid string)
The jobID
or jobUuid
parameter must be specified.
The following parameters can be updated:
Parameter | Description |
---|---|
script | SQL script (only for the SQL job type) |
description | Job description (only for the SQL job type) |
parallelRunsAllowed | The number of parallel runs the job can have; If the number is reached, further starts of the particular job will be ignored. Default: 1 |
retryCounter | Number of retry attempts before the job is set to FAILED state |
retryDelay | Delay in seconds between the retry attempts |
runTimeout
| Individual job timeout in minutes. If no runTimeout is set, configuration set via default value option JOB_RUN_TIMEOUT
will be considered for the job; if runTimeout is reached before the job is finished, the job terminates with the INTERRUPTED state |
owner | Name of the job owner. Owner could be set to a value that is not equal to the current user only by members of admin-role |
runAs | Job runner. Allowed values: CALLER and OWNER . runAs could be set to a value that is not equal to the current user only by the owner or by members of admin-role |
Parameters owner and runAs also can be changed by procedure SYSADMIN.changeResourceOwnerAndExecutor().
jobUuid
, owner
, and runAs
parameters in SYSADMIN.changeJobParameters
are available since v4.1
jobUuid
parameter in
is available since v4.4SYSADMIN.changeSQLJob
SYSADMIN.changeResourceOwnerAndExecutor
procedure is available since v4.5
jobName Parameter
The jobName
parameter serves as a job's unique identifier to support synchronization processes between the CData Virtuality Server instances. It can be specified in all procedures creating any of the non-system jobs. It cannot be specified in job-changing procedures.
Here are some other points to keep in mind:
- When
jobName
is absent in procedure call, it is created by the system automatically; - The system will also create names for jobs on the CData Virtuality Server start when it encounters any job without a
jobName
set; - These names are not meant to be freely editable or selectable, and we do not recommend changing them without a very good reason.
Starting a Job
The startJob
procedure is the quickest way to start a job. In the background, it creates a schedule to run the specified job immediately:
SYSADMIN.startJob(IN id biginteger, IN startDelay integer, IN queueHandler string, IN uuid string)
The job ID or job UUID must be specified.
uuid
parameter in SYSADMIN.startJob
is available since v4.1
Stopping a Job
The stopJob
procedure stops all currently running schedules for a particular job:
SYSADMIN.stopJob(IN id biginteger, IN uuid string)
The job ID or job UUID must be specified.
uuid
parameter in SYSADMIN.stopJob
is available since v4.1
Enabling/Disabling a Job
The enableSchedulerJob
procedure enables or disables a job:
SYSADMIN.enableSchedulerJob(IN id biginteger, IN enabled boolean NOT NULL, IN uuid string)
The job ID or job UUID must be specified.
uuid
parameter in SYSADMIN.enableSchedulerJob
is available since v4.4