3 Replies Latest reply: May 19, 2014 9:12 AM by GregV RSS

    external job creation ORA-27370

    user4772454

      Hi Team,

       

      In oracle documentation it is mentioned

      The CREATE EXTERNAL JOB privilege is required for database users who want to execute jobs that run on the operating system outside the database. By default, this privilege is granted to all users who have been granted the CREATE JOB privilege.


      So as per documentation it is not mandatory to be sysdba could yo please make sure the user who run the job is having  CREATE EXTERNAL JOB privilege


      However although user has CREATE EXTERNAL JOB

       

      running the following

      When running the following statement below:
      SQL> BEGIN
      DBMS_SCHEDULER.create_job (job_name => 'test_shell',
      job_type => 'EXECUTABLE',
      job_action => 'ls -l',
      start_date => SYSDATE,
      repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
      enabled => TRUE,
      COMMENTS => 'Calling shell script from Oracle');
      END;


      getting


      ERROR at line 1:
      ORA-27370: job slave failed to launch a job of type EXECUTABLE
      ORA-27300: OS system dependent operation:accessing extjob wrapper failed with
      status: 13
      ORA-27301: OS failure message: Permission denied
      ORA-27302: failure occurred at: sjsec 3
      ORA-06512: at "SYS.DBMS_ISCHED", line 185
      ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
      ORA-06512: at line 2


      using the following it worked


      Create the script /tmp/run_test.sh with:
      .
      #!/bin/bash
      .
      date >> /tmp/run_test.log
      .
      .
      b. Change permissions to 755 /tmp/run_test.sh
      .
      c. Execute the script and confirm that the file /tmp/run_test.log is created.
      .
      d. As sys execute:
      .
      begin
      dbms_scheduler.create_program
      (
      program_name => 'RUN_TEST',
      program_type => 'EXECUTABLE',
      program_action => '/tmp/run_test.sh',
      enabled => TRUE,
      comments => 'testing script'
      );
      end;
      /
      .
      begin
      dbms_scheduler.create_schedule
      (
      schedule_name => 'EVERY_MIN',
      repeat_interval => 'FREQ=MINUTELY; INTERVAL=1',
      comments => 'Every 1-mins'
      );
      end;
      /
      .
      begin
      dbms_scheduler.create_job
      (
      job_name => 'RUN_TEST_JOB',
      program_name => 'RUN_TEST',
      schedule_name => 'EVERY_MIN',
      comments => 'test script ',
      enabled => TRUE
      );
      end;
      /


      So is it mandatory to use sysdba?


      Thanks in Advance,

      Jo.