scheduler_create_job

Use

In a Scheduler job, you define which DBM command is to be executed when and how often by the Database Manager in the current database instance.

You can specify when the new job is to be scheduled and how often or after which job. If you do not specify how often the new job is to be scheduled, the job is scheduled daily at the defined time or every time the job defined previously is executed.

The DBM operator who created the job is the owner of the job. The system assigns a sequential number for every job created in each database instance.

To create a job, the operational state of the database instance is irrelevant. Whether the scheduler is enabled or disabled is likewise irrelevant.

The new job, however, is only actually executed if the Scheduler is activated and if you have the server authorization to execute the DBM command defined in the job (see: scheduler_start).

See also:

Concepts of the Database System, Automating Administration Tasks

Prerequisites

You have the server authorization SchedulerMgm or Scheduling.

Syntax

scheduler_create_job <condition> <dbm_command> [-o | -once]

<condition> :: = <time> | <previous_job_ID>

Options

Option

Description

<dbm_command>

DMB command to be scheduled

If this contains spaces, then the entire DBM command must be entered in double quotation marks.

<time>

Execution time of the command
Time format:
<hh:mm:ss>
(hours:minutes:seconds)

<previous_job_ID>

Job ID of the previous job

-o | -once

Specifies that the DBM command is to be executed once only

The job is deleted afterwards.

Reply

OK

<job_ID>

<job_ID>

ID for the Scheduler job; issued by the system

In the event of errors, see Reply Format.

Examples

Call the Database Manager CLI in session mode, log on as operator OLEG with the password MONDAY, connect to the database instance DEMODB,

>dbmcli -u OLEG,MONDAY -d DEMODB

dbmcli on DEMODB>

?      Create a scheduler job to stop the database instance at 6 p.m. this evening:

dbmcli on DEMODB>scheduler_create_job 18:00:00 db_offline -o

OK
0

?      Create a second scheduler job to start the database instance at 7 p.m. this evening:

dbmcli on DEMODB>scheduler_create_job 19:00:00 db_online -o

OK
1

?      Create a third scheduler job to ensure that the operational state of the database instance is always displayed after the database instance is started, that is, after job 1:

dbmcli on DEMODB>scheduler_create_job 1 db_state

OK
2

?      Create the fourth job for creating a DBM operator with user name ELENA, password SUNDAY and the same operator properties as OLEG. This job is to be executed once, today at 8 a.m.

dbmcli on DEMODB>scheduler_create_job 08:00:00 "user_create ELENA,SUNDAY OLEG" -once

OK

3