2 Replies Latest reply: Jun 24, 2013 7:06 AM by sushaant RSS

    Executable scheduler job failed

    OraclePSP
      Hi all,

      i'am working with
      - Oracle Database 10g Release 10.2.0.3.0 - 64bit Production
      - AIX Version 5

      I create this :
      DBMS_SCHEDULER.CREATE_JOB(
           job_name             => 'myJobName',
           job_type             => 'EXECUTABLE',
           number_of_arguments  => 1,
           job_action           => '/prg3/app/oracle/MYDIR/myScriptName',
           auto_drop            => FALSE,
           enabled              => FALSE
      );
      I run myJobName like this :
      DBMS_SCHEDULER.PURGE_LOG(job_name=>'myJobName');
      DBMS_SCHEDULER.SET_JOB_ARGUMENT_VALUE('myJobName',1,'mySubdirName');
      DBMS_SCHEDULER.ENABLE('myJobName');
      In myScriptName i create a subdirectory named after the parameter and create a tar archive named after the parameter like this :
      mkdir $1
      move *.txt $1
      tar myTarArchive_$1.tar $1
      Quering USER_SCHEDULER_JOB_ARGS i verify that the parameter is set correctly.

      Quering USER_SCHEDULER_JOB_LOG the status is SUCCEEDED

      Quering USER_SCHEDULER_JOB_RUN_DETAILS the status is SUCCEEDED

      BUT

      ADDITIONAL_INFO is :
      STANDARD_ERROR=mkdir: cannot access directory ...: Permission denied
      mv: cannot rename *.txt to mySubdirName: No such file or directory
      tar: myTarArchive_mySubdirName.tar: No such file or directory
      Debugging the script on the server logged as oracle it work correctly.
      I also check externaljob.ora and the user is set as oracle .

      Any suggestion or advice will be apreciated.
      Thanks to all.