ORA-27369: job of type EXECUTABLE failed with exit code: Permission denied

不一樣的天空w發表於2018-01-23
新加的一個SCHEDULER作業,用普通使用者執行報許可權不足

作業上線後alter日誌裡面報:
ORA-12012: error on auto execute of job 318537
ORA-27369: job of type EXECUTABLE failed with exit code: Permission denied
Tue Oct 15 10:31:00 2013

trace檔案裡記錄:
*** 2013-10-15 10:30:10.920
*** SESSION ID:(717.33910) 2013-10-15 10:30:10.920
*** CLIENT ID:() 2013-10-15 10:30:10.920
*** SERVICE NAME:(SYS$USERS) 2013-10-15 10:30:10.920
*** MODULE NAME:(DBMS_SCHEDULER) 2013-10-15 10:30:10.920
*** ACTION NAME:(PRODUCT_UP131015103008879041) 2013-10-15 10:30:10.920
MODULE NAME:(DBMS_SCHEDULER) 
ACTION NAME:(PRODUCT_UP131015103008879041)
從這兩行可以看出來是SCHEDULER排程作業出現了問題,ACTION NAME其實就是SCHEDULER作業的job_name

檢查這個作業
大概意思如下:
 begin
      dbms_scheduler.create_job(
      job_name => 'goolen_job',
      job_type => 'EXECUTABLE',
      job_action => '/home/oracle/task/goolen.sh',
      start_date => systimestamp,
      number_of_arguments => 0,
      enabled => true,
      auto_drop => true,
      comments => 'ShangJia');
    end;
/

[oracle@goolen]$ cat goolen.sh 
#!/bin/sh
source ~/.bash_profile
export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK"
DATE=`date +%Y%m%d_%H%M%S`
LOGFILE=/tol/logs/product/goolen.log
$ORACLE_HOME/bin/sqlplus -S "newcourse/XXXXXX" << EOF
        spool $LOGFILE
        select sysdate from dual;
  spool off
  exit
EOF

剛開始懷疑是這個使用者沒有相應的執行許可權,但是檢視許可權後並不是這個原因

後來查閱了一些資料,解決了這個問題

# cd $ORACLE_HOME/rdbms/admin/
# chown root:oinstall externaljob.ora 
# chmod 640 externaljob.ora 

# ll externaljob.ora 
-rw-r----- 1 root oinstall 1534 Oct 15 17:51 externaljob.ora

# vim externaljob.ora 
run_user = oracle 
run_group = oinstall 

# ll ../../bin/extjob
-rwxr-x--- 1 oracle oinstall 1223972 Nov 26  2012 ../../bin/extjob
# chmod 4750 ../../bin/extjob
# ll ../../bin/extjob        
-rwsr-x--- 1 oracle oinstall 1223972 Nov 26  2012 ../../bin/extjob

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/31397003/viewspace-2150423/,如需轉載,請註明出處,否則將追究法律責任。

相關文章