Background documentationscheduler_create_job Locate this document in the navigation structure

 

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

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 as its predecessor 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 per database.

For creating a job, the operational state of the database is irrelevant. Likewise, it is irrelevant whether the scheduler is on or off.

The new job, however, is only actually executed if the job is active (see: scheduler_activate_job), if the scheduler is on (see: scheduler_start), and if you have the server permission to execute the DBM command defined in the job.

Prerequisites

You have the server permission SchedulerMgm or you are the owner of the job and have the

Scheduling server authorization.

Structure

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

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

Options

Option

Description

<dbm_command>

DMB command to be scheduled

If it contains spaces, enter the entire DBM command 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

The DBM command is executed once only.

The job is deleted afterwards.

Result

OK

<job_ID>

Values for the Reply Fields

Value

Description

<job_ID>

ID of the scheduler job issued by the system

In the event of errors, see Reply Format.

Example

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

>dbmcli -u OLEG,MONDAY -d DEMODB

dbmcli on DEMODB>

Create a scheduler job to stop the database at 6:00 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 at 7:00 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 is always displayed after the database start, that is, after job 1:

dbmcli on DEMODB>scheduler_create_job 1 db_state

OK 2

Create a fourth job to create a DBM operator with the user name ELENA, the password SUNDAY and user attributes like the user OLEG. This job is to be executed once, today at 8:00 a.m.

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

OK

3

More Information

Database Administration, Automating Administration Tasks