Skip to Main Content

SQL & PL/SQL

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!

Error Using dbms_scheduler to call a shell script

781163Jun 24 2010 — edited Jun 25 2010
Hi,
I have been assigned a job of sending emails through unix utility(Mailx), based on certain activity in database.
Email needs to be sent on insert/update of a column in one of the database tables.
I am trying to use the block below to call the unix script responsible to send mails:

begin
dbms_scheduler.create_job
(
job_name => 'TPP_SEND_EMAIL_JOB',
job_type => 'EXECUTABLE',
job_action => '/opt/ENV/code/BIL/users/usrbil01/Hemz/sndmailscrpt.ksh',
repeat_interval => 'FREQ=MINUTELY; INTERVAL=30',
enabled => true,
comments => 'Send Email on ISU update'
);
end;
/

sndmailscrpt.ksh: Script to send email is embedded within the shell script

I am getting the below error when i try to run the job using 'exec dbms_scheduler.run_job('TPP_SEND_EMAIL_JOB');'
Error:
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:accessing extjob wrapper failed with status: 2
ORA-27301: OS failure message: No such file or directory
ORA-27302: failure occurred at: sjsec 3
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 1


I am not aware of any db related permissions that needs to be given, is this related to that or is there somethin i need to do for execution to be successfull
Request you to let me know the exact solution and also the steps i need to take in order to ensure successfull execution of this script.

Please also let me know if there is any other way wherein i can call a unix script from a database trigger on run time(i.e, whenever insert/update on a particular column in database)

Regards,
Hemanth
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2010
Added on Jun 24 2010
11 comments
1,501 views