Scheduled Job Running Shell Script Fails With ORA-27369

Scheduled Job Running Shell Script FailsWith ORA-27369

Applies to:

Oracle Server - Enterprise Edition -Version: 10.1.0.2 to 10.2.0.4

Oracle Server - Standard Edition -Version: 10.1.0.2 to 10.2.0.4

including Version:11.2.0.4

Sun Solaris SPARC (64-bit)

Linux x86

"ORA-27369: job of type EXECUTABLEfailed with exit code: Unknown error" was still occurring for non oracle users running DBMS_SCHEDULER executed shellscripts. Problem was fixed when filesystem where ORACLE_HOME was mountedon was found to have been mounted w/ nosetuid. Changing mount option to setuidresolved problem

Symptoms

@Checked for relevance on 16-MAY-2008

A Scheduler job has been configuredusing the DBMS_SCHEDULER package. The job executes a shell script using theoption job_type=>’EXECUTABLE’. The script performs a write operation to anoutput file, for example a redirect operation or touch. The write operationfails with:

ORA-27369: job of type EXECUTABLE failedwith exit code: Operation not permitted

Or

ORA-27369: job of type EXECUTABLE failedwith exit code: 274662

Or

ORA-27369: job of type EXECUTABLE failedwith exit  code: Unknownerror

Indba_scheduler_job_run_details.additional_info, the following details arerecorded:

ORA-27369: job of type EXECUTABLE failedwith exit code: Operation not permitted

STANDARD_ERROR="touch: cannot touch`’: Permission denied"

Or

ORA-27369: job of type EXECUTABLE failedwith exit code: 274662

STANDARD_ERROR="Oracle Schedulererror: Config file is not owned by root or is

writable by group or other or extjob isnot setuid and owned by root"

Cause

If$ORACLE_HOME/rdbms/admin/externaljob.ora exists then external jobs run as theuser and group specified in this file, which by defaultis a lowly privileged user (nobody).

The user ‘nobody’ andthe group ‘nobody’ do not have the proper privileges for write operations.

As a result, themessage ‘Permission denied’ is returned when attempting to write to files.

Solution

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 rootexternaljob.ora

2. Ensure the file permissions arecorrectly set for $ORACLE_HOME/rdbms/admin/externaljob.ora.

Remove write privileges from group andother.

# chmod 640externaljob.ora

# ls -la externaljob.ora

-rw-r—– 1 root oinstall 1537 Sep 1309:24 externaljob.ora

3. Edit$ORACLE_HOME/rdbms/admin/externaljob.ora and set run_user to the OS accountthat owns the Oracle installation and the database and run_group to the OSgroup that owns the Oracle_Home.

Example:

OS account: oracle

OS group: oinstall

run_user = oracle

run_group = oinstall

4. Ensure the setuid bit is set on the$ORACLE_HOME/bin/extjob executable.  Alsomake sure the filesystem is mounted with setuid option.

# cd$ORACLE_HOME/bin

# chown rootextjob

# chmod 4750extjob

# ls -la extjob

-rwsr-x— 1 root oinstall 64988 Mar 2918:22 extjob

时间: 2024-10-10 07:34:42

Scheduled Job Running Shell Script Fails With ORA-27369的相关文章

Shell script fails: Syntax error: “(” unexpected

Shell script fails: Syntax error: “(” unexpected google 一下. http://unix.stackexchange.com/questions/45781/shell-script-fails-syntax-error-unexpected The script does not begin with a shebang line, so the kernel executes it with /bin/sh. On Ubuntu, /bi

这些年我们一起搞过的持续集成~Jenkins+Perl and Shell script

这些年我们一起搞过的持续集成~Jenkins+Perl and Shell script ##本文同一时候发表在http://www.cnblogs.com/wade-xu/p/4378224.html ##转载注明出处 部门用持续集成已经非常久了,但事实上使用起来还是非常麻烦的.每当要给一个新项目set up持续集成的环境,尽管是Copy一些现有的jobs, 可是很多參数,变量须要去改,然后还有调试,少说3,4天搞一下,非常不方便. 近期比較空,就把现有的持续集成系统升级改造下,job用一套模

Why to Write Shell Script

Why to Write Shell Script ? Shell script can take input from user, file and output them on screen. Useful to create our own commands. Save lots of time. To automate some task of day today life. System Administration part can be also automated.

学习shell script

如果你的想要管理好你的主机,那么就要好好学习自动管理系统的有效工具--hell script!基本上,shell script有点像早期的批处理文件,即将很多命令整合起来一次执行,但是shell script拥有更强大的功能,它可以进行类似程序的编写,并且不需要经过编译就能够执行,非常方便我们对系统进行管理. 今天我们主要通过对一些shell script的习题来加深对脚本知识的学习. 习题1:对成绩进行判断,要求输入一个正整数,以60分,85分为界输出不同的评语. #!/bin/bash #

shell编程 Shell script 的默认变量($0, $1...)

Shell script 的默认变量($0, $1...) 我们知道指令可以带有选项与参数,例如 ls -la 可以察看包含隐藏文件的所有属性与权限.那么 shell script 能不能在脚本文件名后面带有参数呢?很有趣喔!举例来说,如果你想要重新启动系统登录文件的功能,可以这样做: [[email protected] ~]# file /etc/init.d/syslog /etc/init.d/syslog: Bourne-Again shell script text executab

執行shell script與subshell

兩種方法 喚起新shell再執行shell scripts 在目前shell執行shell scripts 喚起另一個shell來執行的scripts在scripts檔頭最前面前要加 #! /bin/sh 第一種方法是在shell script 文字檔前指出shell scripts解讀的程式在那(也就是 我們的shell)然後把文字檔的執行權限打開,照一般執行可執行檔方式執行或者叫 一個shell來解釋文字檔test.sh. $ test.sh $ /bin/sh test.sh $ ( .

linux shell script: Basic concept01 - String

basic concept01: String本文所有的测试例如无特殊说明,均based on fish shell 就从字符串说起吧,啥是字符串就不用解释了,我们来看几个简单的例子 ?> ~ set param abc ?> ~ echo "string with blank and $param surrounded with double quotation marks" string with blank and abc surrounded with double

SSH防止暴力破解 shell script

这是我的第一个Shell Script,写的乱乱糟糟,试验了一下,还是可用的,目前已经在我自己的WEB服务器上跑起来了!!~~ #!/bin/bash #这个shell script 用来防止SSH暴力破解 #Auther:Aaron Guo #Date:Jan 8 2016 #Version:1.2 # 指定该SHELL的日志文件 logfile="/var/log/blocked_ip" # 获取现在时间,用来grep /var/log/secure. (格式:mm dd HH)

跟鸟哥学Linux之——shell script

从程序员的角度来看,Shell本身是一种用C语言编写的程序,从用户的角度来看,Shell是用户与Linux操作系统沟通的桥梁.用户既可以输入命令执行,又可以利用 Shell脚本编程,完成更加复杂的操作.在系统管理等领域,Shell编程起着不可忽视的作用.前期我对shell编程做了一个初步的认识,现总结如下: 思维导图: 知识分为了两部分: 基本知识: 在基本知识中我将其分为了:执行方法.运算式.变量和判断式四部分.1.执行方法就是在Linux中shell文件执行的命令,用的多了自然会没有问题.2