Skip to Main Content

Database Software

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Execute a shell script in linux from pl/sql using a job.

VIRUMar 14 2012 — edited Mar 17 2012
Hi,

I am using ORACLE DATABASE 11g and Oracle Enterprise Linux 5.

I want to execute a shell script with dbms_scheduler.create_job procedure in a pl/sql block. I am using the below code :-
 dbms_scheduler.create_job(
    job_name   => 'TEST',
    job_type   => 'EXECUTABLE',
    job_action => '/bin/bash',
    number_of_arguments => 1,
    start_date => SYSTIMESTAMP,
    enabled    => FALSE);

  dbms_scheduler.set_job_argument_value('TEST', 1, '/tmp/my-temp-script.sh');

  dbms_scheduler.enable('TEST');
But for some reason the shell script does not get executed.
Can any one tell me what i have mistaken here ?

Thanks in advance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Apr 14 2012
Added on Mar 14 2012
26 comments
14,041 views