Showing posts with label DBMS_SCHEDULER. Show all posts
Showing posts with label DBMS_SCHEDULER. Show all posts
Tuesday, August 27, 2019
In this post, we have a given
an example depicting the steps for executing the shell script from
DBMS_SCHEDULER.
Script:
BEGIN
--
Create a Job
DBMS_SCHEDULER.create_job
(job_name =>'TEST_SHELL_SCRIPT_JOB',
job_action =>'/var/tmp/TEMP/TESTSHELL.sh',
job_type =>'EXECUTABLE',
number_of_arguments=>1,
enabled =>FALSE,
auto_drop => TRUE
);
--
define the arguments and their values for each argument (in this case there is
only one)
DBMS_SCHEDULER.set_job_argument_value
(job_name =>'TEST_SHELL_SCRIPT_JOB',
argument_position => 1,
argument_value => 'SHAREORACLEAPPS'
);
--
Since we couldn't enable it when creating it with arguments, enable it now
DBMS_SCHEDULER.enable('TEST_SHELL_SCRIPT_JOB');
--
since we want this Job to execute now, we call run_job
DBMS_SCHEDULER.run_job (job_name=> 'TEST_SHELL_SCRIPT_JOB');
--
if we get here without an error, the job has completed so we can drop it
DBMS_SCHEDULER.drop_job (job_name=> 'TEST_SHELL_SCRIPT_JOB');
EXCEPTION
WHEN OTHERS THEN
DBMS_OUTPUT.PUT_LINE(SQLCODE||SQLERRM);
END;
Testing:
Hope it helps!!
Tuesday, August 27, 2019 by Team search · 1
Sunday, April 14, 2019
Oracle Scheduler - DBMS_SCHEDULER (Database Jobs) – Example Scripts – (Alternate concurrent manager)
In this post, we have introduced a powerful
utility provided by Oracle named as DATABASE JOBS. This can be utilized to
schedule the execution of our custom packages, shell scripts in a predefined
interval.
From oracle apps perspective, this
can be used as a second concurrent manager. We have personally used the same
for triggering emails, updating staging tables in regular interval. It’s so
robust and perfect.
Example Scripts:
Action
|
API
|
Sample Script
|
Create Job
|
DBMS_SCHEDULER.create_job
|
|
Disable Job
|
DBMS_SCHEDULER.disable_job
|
|
Enable Job
|
DBMS_SCHEDULER.enable_job
|
|
Stop Job
|
DBMS_SCHEDULER.stop_job
|
|
Drop Job
|
DBMS_SCHEDULER.drop_job
|
|
Queries
|
ALL_SCHEDULER_JOB_RUN_DETAILS
ALL_SCHEDULER_RUNNING_JOBS
ALL_SCHEDULER_JOBS
|
Hope it helps!!
Sunday, April 14, 2019 by Team search · 0
Subscribe to:
Posts (Atom)
Disclaimer
The ideas, thoughts and concepts expressed here are my own. They, in no way reflect those of my employer or any other organization/client that I am associated. The articles presented doesn't imply to any particular organization or client and are meant only for knowledge Sharing purpose. The articles can't be reproduced or copied without the Owner's knowledge or permission.