Unable to get external script to run using DBMS_SCHEDULER
I've been unable to get an operating system script to execute using DBMS_SCHEDULER on my Red Hat EL4 (64 bit) sytem. After pulling all my hair out I'm beginning to wonder if I'm doing something wrong, or if I have found the first incompatability when using Oracle XE on a 64 bit OS.
I am using the following PL/SQL code:
DBMS_SCHEDULER.create_job(
job_name=>'test_job',
job_type=>'EXECUTABLE',
job_action=>'/tmp/test.sh',
enabled=>FALSE);
DBMS_SCHEDULER.run_job(
job_name=>'test_job',
use_current_session=>TRUE);
Test.sh is a one-line script that has 'ls -l' in it. When I execute this code I receive the following error:
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
I have tried a variety of scripts, and they all give the same error. I have the permissions set so that anyone can run them, and they always work from the operating system command line. I have no problems executing scripts on my Windows Oracle XE system, so I really do think this is a Linux Oracle XE issue.
I checked the USER_SCHEDULER_JOB_RUN_DETAILS and found this additional error message:
ORA-27369: job of type EXECUTABLE failed with exit code: 255
STANDARD_ERROR="execve: Exec format error"
Has anyone else experienced this problem and come up with a solution? Am I just doing something wrong?
Any help appreciated!
- Jim