8 Replies Latest reply: Mar 21, 2013 10:59 AM by Prem Kumar RSS

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

    Prem Kumar
      Dear experts,

      I have created a simple external job to run export (expdp) job to be run from PL/SQL. When I create a job as SYS user, the job runs good but the same fails when I execute it as application user. I am certain that I am missing some privileges. I did go through internet, MOS for a solution but couldn't find one (my bad!).

      Appreciate if you could point me to the right direction.

      Below is the job:
      BEGIN
      dbms_scheduler.create_job(
      job_name => 'mytestjob',
      job_type => 'executable',
      job_action => '/u01/myexpdp.sh',
      enabled => TRUE,
      auto_drop         =>   FALSE);
      END;
      /
      
      
      exec dbms_scheduler.run_job('mytestjob');
      execution of job as user "TEST"
      SQL> show user
      USER is "TEST"
      SQL>
      
      SQL> exec dbms_scheduler.run_job('mytestjob');
      BEGIN dbms_scheduler.run_job('mytestjob'); END;
      
      *
      ERROR at line 1:
      ORA-27369: job of type EXECUTABLE failed with exit code: Permission denied
      ORA-06512: at "SYS.DBMS_ISCHED", line 185
      ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
      ORA-06512: at line 1
      
      
      SQL>
      file permissions
      -rwxrwxrwx 1 oracle oinstall 1539 Mar 21 17:58 /u01/myexpdp.sh
      expdp script
      cat /u01/myexpdp.sh
      
      #!/bin/bash
      source /home/oracle/.bash_profile
      
      ORACLE_SID=TESTDB
      
      /u01/app/oracle/product/11.2.0.1/db1/bin/expdp parfile=/u01/expoptions.txt
      expdp parameter file
      cat u01/expoptions.txt
      userid=scott/tiger
      directory=DATA_PUMP_DIR
      dumpfile=test.dmp
      tables=emp
      Edited by: Prem Kumar on Mar 21, 2013 4:14 AM