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.
For creating 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)
scheduler_create_job <condition> <dbm_command> [-o | -once]
<condition> :: = <time> | <previous_job_ID>
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 |
The DBM command is executed once only. The job is deleted afterwards. |
OK
<job_ID>
Value | Description |
---|---|
<job_ID> | ID for the Scheduler job; issued by the system |
In the event of errors, see Reply Format.
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: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 instance at 7:00 p.m. this evening:
dbmcli on DEMODB>scheduler_create_job 19:00:00 db_offline -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 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 user name ELENA, 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
Database Administration, Automating Administration Tasks