I got ” ORA-27369: job of type EXECUTABLE failed with exit code ” error in Oracle database.
ORA-27369: job of type EXECUTABLE failed with exit code
Details of error are as follows.
ORA-27369: 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.
A Scheduler job has been configured using the DBMS_SCHEDULER package. The job executes a shell script using the option job_type=>'EXECUTABLE'. The script performs a write operation to an output file, for example a redirect operation or touch. The write operation fails with: ORA-27369: job of type EXECUTABLE failed with exit code: Operation not permitted Or ORA-27369: job of type EXECUTABLE failed with exit code: 274662 Or ORA-27369: job of type EXECUTABLE failed with exit code: Unknown error In dba_scheduler_job_run_details.additional_info, the following details are recorded: ORA-27369: job of type EXECUTABLE failed with exit code: Operation not permitted STANDARD_ERROR="touch: cannot touch `<file_name>': Permission denied" Or ORA-27369: job of type EXECUTABLE failed with exit code: 274662 STANDARD_ERROR="Oracle Scheduler error: Config file is not owned by root or is writable by group or other or extjob is not setuid and owned by root"
Job of type EXECUTABLE failed with exit code: %s.
This ORA-27369 error is related to the problem was encountered while running a job of type EXECUTABLE.
The cause of the actual problem is identified by the exit code.
Correct the cause of the exit code and reschedule the job.
If $ORACLE_HOME/rdbms/admin/externaljob.ora exists then external jobs run as the user and group specified in this file, which by default is a lowly privileged user (nobody).
The user ‘nobody’ and the group ‘nobody’ do not have the proper privileges for write operations.
As a result, the message ‘Permission denied’ is returned when attempting to write to files.
Certain files may need additional permissions and the proper ownership. Root may be required for some jobs, while the Oracle user may be sufficient for others. It will vary case to case. In the below example, the root user is used.
Root access is required for the steps below.
1. Ensure the configuration file $ORACLE_HOME/rdbms/admin/externaljob.ora is owned by root:
# cd $ORACLE_HOME/rdbms/admin/ # chown root externaljob.ora
2. Ensure the file permissions are correctly set for $ORACLE_HOME/rdbms/admin/externaljob.ora.
Remove write privileges from group and other.
# chmod 640 externaljob.ora
# ls -la externaljob.ora
-rw-r----- 1 root oinstall 1537 Sep 13 09:24 externaljob.ora
3. Ensure the setuid bit is set on the $ORACLE_HOME/bin/extjob executable. Also make sure the filesystem is mounted with setuid option.
# cd $ORACLE_HOME/bin
# chmod 4750 extjob
# ls -la extjob
-rwsr-x--- 1 root oinstall 64988 Mar 29 18:22 extjob
BEGIN dbms_scheduler.create_job(job_name => 'myjob', job_type => 'executable', job_action => '/usr/users/oracle/admin/bin/test.bash', enabled => TRUE, auto_drop => TRUE); END; / exec dbms_scheduler.run_job('myjob');
Errors in file /dev_app/oracle/admin/DEV/bdump/dev_j000_1194159.trc: ORA-12012: error on auto execute of job 11212220 ORA-27369: job of type EXECUTABLE failed with exit code: Not owner
Setup of the $ORACLE_HOME/bin/extjob directory was incorrectly setup for an invalid user.
Change the owner of the $ORACLE_HOME/bin/extjob directory to the owner being used.
May also need to edit externaljob.ora and set run_user to Oracle user as suggested in Note 391820.1.
Do you want to learn Oracle Database for Beginners, then read the following articles.
Oracle Tutorial | Oracle Database Tutorials for Beginners ( Junior Oracle DBA )