Narayanan -- Thanks for the question regarding "scheduler-calling shell script", version 10.2.0.1.0
Submitted on 8-Jan-2008 8:39 Central time zone
Last updated 8-Jan-2008 10:11
You Asked
I have created a job in oracle 10.2.0.1.0 /linux
BEGIN
dbms_scheduler.CREATE_JOB (
job_name => 'TEST_JOB',
job_type => 'EXECUTABLE',
job_action => '/tmp/test1.sh',
start_date => '01-jan-08 05:51:00 PM US/Pacific',
repeat_interval => 'FREQ=DAILY',
end_date => '06-jan-08 4.00.00 PM US/Pacific',
enabled => TRUE,
comments => 'My test job');
END;
/tmp/test1.sh (copy a file from host to remote m/c)
------------------
#!/bin/bash
scp /tmp/x.txt <remote user>@<remote m/c hostname>:/tmp/x.txt
while running the job i' am getting
ORA-27369: job of type EXECUTABLE failed with exit code: 255
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 2
but , By Giving directly as os command
the below command works fine.
scp /tmp/x.txt <remote user>@<remote m/c hostname>:/tmp/x.txt
but i need to execute through oracle scheduler.
More info
---------
1) select log_date, job_name, status, additional_info from
user_scheduler_job_logwhere job_name = 'TEST_JOB'
07-JAN-2008 , TEST_JOB , FAILED ,"manually run"
2) select additional_info from DBA_SCHEDULER_JOB_RUN_DETAILS where
job_name='TEST_JOB'
ORA-27369: job of type EXECUTABLE failed with exit code: 255
STANDARD_ERROR="execve: Exec format error"
Help me in resolving the problem
================================
and we said...
standard debugging techniques....
put some debug in your script - echo to a file...
especially echo your environment - in all likelihood the environment is nothing like what you expect (the environment comes from the oracle server environment, not your normal environment) and scp is "not found" - it is not in the path.
have a look at ssh
January 10, 2008 - 4am Central time zone
Reviewer: Friedhelm Büscher from Germany
You are making a ssh connection to a remote host without password. I guess, you are using key-auth.
Make sure, that especially the $HOME Environment is set correctly so that the private key can be
found.
regards,
Friedhelm