Oracle7 Server Distributed Systems Volume II: Replicated Data
Using Job Queues
To schedule and manage jobs in the job queue, use the procedures in the DBMS_JOB package.
DBMS_JOB Package
Table 10 - 2 lists the job queue procedures in the DBMS_JOB package.
Procedure
| Description
| Discussed
|
SUBMIT
| Submits a job to the job queue.
|
|
REMOVE
| Removes specified job from the job queue.
|
|
CHANGE
| Alters a specified job. You can alter the job description, the time at which the job will be run, or the interval between executions of the job.
|
|
WHAT
| Alters the job description for a specified job.
|
|
NEXT_DATE
| Alters the next execution time for a specified job.
|
|
INTERVAL
| Alters the interval between executions for a specified job.
|
|
BROKEN
| Disables or enables job execution. If a job is marked as broken, Oracle does not attempt to execute it.
|
|
RUN
| Forces a specified job to run.
|
|
Table 10 - 2. Procedures in the DBMS_JOB Package
Privileges and Job Queues
There are no database privileges associated with using job queues. Any user who can execute the job queue procedures can use the job queue.
Environment of a Job
When you submit a job to the job queue or alter a job's definition, Oracle records certain characteristics of your current environment. These characteristics include the following:
- user submitting or altering the job
- MAC privileges (if appropriate)
- the following NLS parameters
Note that the NLS_LANGUAGE and NLS_TERRITORY parameters are used as the basis for defaults of unspecified NLS parameters.
Every time a job is executed, Oracle restores the job's environment. Thus, jobs run in the same environment in which they were submitted.
A job can change its environment by using the DBMS_SQL package and the SQL command ALTER SESSION. For more information about the DBMS_SQL package, see the Oracle7 Server Application Developer's Guide. For more information about the ALTER SESSION command, see the Oracle7 Server Administrator's Guide.
Import/Export and Job Queues
Jobs can be exported and imported. Thus, if you define a job in one database, you can transfer it to another database. When exporting and importing jobs, the job's number, environment, and definition remain unchanged.
Attention: If the job number of a job you want to import matches the number of a job already existing in the database, you will not be allowed to import that job. Submit the job as a new job in the database.