Hi:
I have seen this question asked quite a few times but gone mostly unanswered. One "fix" I did see (for 10g?) was to run root.sh again and that did not change anything for me.
--------------------------------------------------------------------------------
| Oracle Database 11g Enterprise Edition Release 11.2.0.4.0 - 64bit Production | |
| PL/SQL Release 11.2.0.4.0 - Production | |
| CORE 11.2.0.4.0 Production | |
| TNS for Linux: Version 11.2.0.4.0 - Production | |
NLSRTL Version 11.2.0.4.0 - Production
I have created an external job and tried to run it without success. I believe I have the various control files (extjob, externaljob.ora, extjobo) set correctly. I have tried running with and without credentials (I believe supplying credentials makes the contents of the externaljob.ora file moot?)
The database user trying to run the job has been granted CREATE ANY JOB, CREATE EXTERNAL JOB and CREATE JOB and been granted SCHEDULER_ADMIN role (and DBA role for that matter!)
The script wish to run, /u00/vmstat.sh:
#!/bin/bash
/usr/bin/vmstat >> /u00/test/vmstat.LST
echo $?
$ ll vmstat.sh
-rwx--x--x. 1 oracle oinstall 60 Nov 29 20:07 vmstat.sh
Control file permissions:
$ ll /u01/app/oracle/product/11.2.0/db_1/bin/extjob
-rwsr-x---. 1 root oinstall 1254220 Sep 19 15:06 /u01/app/oracle/product/11.2.0/db_1/bin/extjob
$ ll /u01/app/oracle/product/11.2.0/db_1/bin/extjobo
-rwxr-xr-x. 1 oracle oinstall 1254220 Sep 19 15:06 /u01/app/oracle/product/11.2.0/db_1/bin/extjobo
$ ll /u01/app/oracle/product/11.2.0/db_1/rdbms/admin/externaljob.ora
-rw-r-----. 1 root oinstall 1572 Nov 29 21:35 /u01/app/oracle/product/11.2.0/db_1/rdbms/admin/externaljob.ora
Contents of externaljob.ora (I've tried run_group=oinstall as well, no difference):
#run_user = nobody
run_user = oracle
#run_group = nobody
run_group = dba
Credential (Does database_role need to be set? I'm not sure what it is, we're defining an OS user with this.):
BEGIN
sys.dbms_scheduler.create_credential(
username => 'oracle',
password => 'mypw',
database_role => NULL,
windows_domain => NULL,
comments => NULL,
credential_name => '"GAFF"."ORACLE_CRED"'
);
END;
Create the job:
begin
dbms_scheduler.create_job(
job_name => 'TEST_JOB',
job_type => 'EXECUTABLE',
job_action => '/u00/test/vmstat.sh',
start_date => SYSDATE,
enabled => FALSE,
repeat_interval => NULL);
end;
Set the credential:
begin
dbms_scheduler.set_attribute('TEST_JOB','credential_name','ORACLE_CRED');
end;
Enable the job (I checked for results in the directory after this thinking it would run immediately but no file was created and enabling the job triggered no errors):
BEGIN
DBMS_SCHEDULER.enable(name=>'"GAFF"."TEST_JOB"');
END;
Run the job:
begin
dbms_scheduler.run_job(job_name => 'TEST_JOB', use_current_session=> TRUE);
end;
Error:
Error starting at line : 25 in command -
begin
dbms_scheduler.run_job(job_name => '"GAFF"."TEST_JOB"', use_current_session=> TRUE);
end;
Error report -
ORA-27369: job of type EXECUTABLE failed with exit code: Input/output error
ORA-06512: at "SYS.DBMS_ISCHED", line 196
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at line 2
27369. 00000 - "job of type EXECUTABLE failed with exit code: %s"
*Cause: A problem was encountered while running a job of type EXECUTABLE.
The cause of the actual problem is identified by the exit code.
*Action: Correct the cause of the exit code and reschedule the job.
The run log additional_info shows:
"EXTERNAL_LOG_ID="job_101748_107700",
ORA-27369: job of type EXECUTABLE failed with exit code: Input/output error
STANDARD_ERROR="Launching external job failed: Login executable not setuid-root""
I'm not sure what this means. Does my shell script have to be setuid-root? (I tried this and it made no difference).
I don't see what's wrong here. I have Oracle 10gR2 on earlier Linux kernels where I can run external jobs. The only difference I see with the OS is that the newer system (which I can't run external jobs on) has the SELinux context enabled. You see a dot at the end of the file permissions. But I've disabled the SELinux check and tried running this external job and that doesn't seem to matter either.
Any help would be appreciated! I've been looking at this for a few days now!
Message was edited by: Gaff