DBMS_DATA_TOOLS_JOBS Package Reference
This chapter provides information about the packages you use with the Jobs feature in Data Studio. The Summary of DBMS_DATA_TOOLS_JOBS
Subprograms topic also covers the procedures included in the DBMS_DATA_TOOLS_JOBS
package.
Summary of DBMS_DATA_TOOLS_JOB Subprograms
The DBMS_DATA_TOOLS_JOB
package provides a collection of scheduling functions and procedures you use with the Jobs feature in the Data Studio suite of tools.
DBMS_DATA_TOOLS_JOB Package Subprograms
The following table lists the DBMS_DATA_TOOLS_JOB
subprograms and briefly describes them.
Table 19-2 DBMS_DATA_TOOLS_JOB Names and description for the DBMS_DATA_TOOLS_JOB Subprograms
Subprogram | Description |
---|---|
Create Job procedure | This procedure creates a new job. |
Delete Job procedure | Deletes the job from the scheduler. |
Rename Job procedure | Renames the job with the desired name. |
Update Job procedure | Modifies the attributes of an existing job. |
Run procedure | Runs a job immediately regardless of the schedule you define. |
Stop Job procedure | Stops a running job. This terminates a job gracefully, and if necessary, forcibly stop it. |
CREATE_JOB Procedure
This procedure creates a single job. If you create the job as enabled by setting the enabled attribute to TRUE, the Scheduler automatically runs the job according to its schedule. If you create the job disabled, the job does not run until you enable it with the Enable Job feature.
Syntax
dbms_data_tools_job.create_job(
job_name in varchar2,
description in varchar2,
steps in clob,
owner in varchar2 default null,
start_date IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
repeat_interval IN VARCHAR2 DEFAULT NULL,
end_date IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
job_class IN VARCHAR2 DEFAULT NULL,
enabled IN BOOLEAN DEFAULT FALSE,
reporting in clob default null);
CREATE_JOB Procedure Parameters
Table 19-3 CREATE_JOB Procedure Parameters
Parameter | Description |
---|---|
Job Name | The name to assign to the job. If job_name is not specified, an error is generated.
|
Description | This refers to additional information that is set for jobs. |
Steps | This refers to various tasks the Data Studio tool performs that comprises of a job.
Steps is a JSON array. Each array element is a JSON object. Here are the JSON elements which apply to all objects:
Each object type has some additional elements depending on the type. data_load :
smart_table :
procedure :
|
Owner |
It is the schema in which the job is created. If you create a job without specifying a schema, the owner will be the user executing the |
Start Date |
This attribute specifies the first date and time on which this job is scheduled to start. If For repeating jobs that use a calendaring expression to specify the repeat interval, The Scheduler cannot guarantee that a job executes on an exact time because the system may be overloaded and thus resources unavailable. |
Repeat Interval |
This attribute specifies how often the window repeats. It is expressed using the Scheduler calendaring syntax. See "Calendaring Syntax" for more information. A PL/SQL expression cannot be used to specify the repeat interval for a window. The expression specified is evaluated to determine the next time the window opens. If no |
End Date |
This attribute specifies the date and time after which the job expires and is no longer run. The value for end_date is specified, the job repeats forever unless you stop job .
|
Job Class | The class this job is associated with. |
Enabled | This attribute specifies whether the job is created enabled or not. The possible settings are TRUE or FALSE . By default, this attribute is set to FALSE and, therefore, the job is created as disabled. A disabled job means that the metadata about the job has been captured, and the job exists as a database object. However, the Scheduler ignores the job and the job coordinator does not pick it for processing. In order for the job coordinator to process the job, the job must be enabled. You can enable a job by selecting the Enable Job icon.
|
Reporting | This attribute specifies job execution details via Report button in the Jobs feature.
This is a JSON object similar to the reporting argument for
dbms_live_feed . It can have the following elements:
Each of these four elements can specify an array of email address in the |
DELETE_JOB Procedure
This procedure deletes a job.
Syntax
dbms_data_tools_job.delete_job(job_name in varchar2, owner in varchar2 default null);
DELETE_JOB Procedure Parameters
Table 19-4 DELETE_JOB Procedure Parameters
Parameter | Description |
---|---|
Job Name | The name to assign to the job. If job_name is not specified, an error is generated.
|
Owner |
It is the schema in which the job is created. If you create a job without specifying a schema, the owner will be the user executing the |
RENAME_JOB Procedure
This procedure renames a job.
Syntax
dbms_data_tools_job.rename_job(old_job_name in varchar2,
new_job_name in varchar2,
owner in varchar2 default null);
RENAME_JOB Procedure Parameters
Table 19-5 RENAME_JOB Procedure Parameters
Parameter | Description |
---|---|
Old Job Name | The name of the existing job. |
New Job Name |
The name of the new job. |
Owner |
It is the schema in which the job is created. |
UPDATE_JOB Procedure
This procedure updates any of the existing job attributes.
Syntax
dbms_data_tools_job.update_job(job_name in varchar2,
owner in varchar2 default null,
description in varchar2 default null,
steps in clob default null,
start_date IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
repeat_interval IN VARCHAR2 DEFAULT NULL,
end_date IN TIMESTAMP WITH TIME ZONE DEFAULT NULL,
job_class IN VARCHAR2 DEFAULT NULL,
enabled IN BOOLEAN DEFAULT NULL,
reporting in clob default null);
UPDATE_JOB Procedure Parameters
Table 19-6 UPDATE_JOB Procedure Parameters
Parameter | Description |
---|---|
Job Name | The name of the Job to update. |
Owner |
It is the schema in which the job is to be updated. |
Description | The updated description to apply. |
Steps | The new steps to update to. |
Start Date | The new start date. |
Repeat Interval | The updated repeat interval. |
End Date | The updated end date. |
Job Class | The updated job class. |
Enabled | It could be enabled or disabled. |
Reporting | The updated reporting attribute. |
Run Procedure
This procedure runs a job immediately.
If a job is enabled, the Scheduler runs it automatically. It is not necessary to call RUN_JOB
to run a job according to its schedule. Use RUN_JOB
to run a job outside of its normal schedule.
Syntax
dbms_data_tools_job.run(job_name in varchar2,
owner in varchar2 default null,
use_current_session in number default null,
options in clob default null);
RUN Procedure Parameters
Table 19-7 RUN Procedure Parameters
Parameter | Description |
---|---|
Job Name |
A job name or a comma-separate list of entries, where each is the name of an existing job, optionally preceded by a schema name and dot separator. If you specify a multiple-destination job, the job runs on all destinations. In this case, the |
Owner |
It is the schema in which the job is run. |
Use Current Session |
This specifies whether or not the job run should occur in the same session that the procedure was invoked from. When
use_current_session is set to TRUE :
When
use_current_session is set to FALSE :
|
Options |
STOP_JOB Procedure
This procedure stops currently running jobs or all jobs in a job class.
After stopping the job, the state of a one-time job is set to STOPPED
, whereas the state of a repeating job is set to SCHEDULED
or COMPLETED
, depending on whether the next run of the job is scheduled.
Syntax
dbms_data_tools_job.stop_job(job_name in varchar2,
owner in varchar2 default null,
force in boolean default false);
STOP_JOB Procedure Parameters
Table 19-8 STOP_JOB Procedure Parameters
Parameter | Description |
---|---|
Job Name |
Name of a job to stop. It is the name of an existing job, optionally preceded by a schema name and dot separator. |
Owner |
It is the schema in which the job is to be stopped. |
Force |
If If Use of the |