DBMS_SCHEDULER FAILS WITH ORA-27369 WHEN JOB TYPE IS EXECUTABLE (Doc ID 279866.1)

Last updated on DECEMBER 06, 2016

Applies to:

Oracle Database - Enterprise Edition - Version 10.1.0.2 and later
Information in this document applies to any platform.
***Checked for relevance on 13-Oct-2015***

Symptoms

Create a shell script to touch a file as below :-

cat /tmp/test.sh

#!/usr/bin/ksh
/usr/bin/touch /tmp/harry

on unix prompt we are able to run the script without any issues , but failing through dbms_scheduler after submitting the job as below

begin
dbms_scheduler.create_program
(
program_name => 'test',
program_type => 'EXECUTABLE',
program_action => '/tmp/test.sh',
enabled => TRUE,
comments => 'testing script'
);
end;


begin
dbms_scheduler.create_schedule
(
schedule_name => 'EVERY_5_MINS',
repeat_interval => 'FREQ=MINUTELY; INTERVAL=5',
comments => 'Every 5-mins'
);
end;

begin
dbms_scheduler.create_job
(
job_name => 'TEST',
program_name => 'TEST',
schedule_name => 'EVERY_5_MINS',
comments => 'test script ',
enabled => TRUE
);
end;


SQL> select status,run_duration,actual_start_date,additional_info
     from dbA_scheduler_job_run_details
     where job_name='TEST';


STATUS RUN_DURATION ACTUAL_START_DATE
------------- ------------------------- ---------------------------------------------------------
FAILED +000 00:00:01 02-AUG-04 10.53.35.650626 PM -06:00

ADDITIONAL_INFO
--------------------------------------------------------------------------------
ORA-27369: job of type EXECUTABLE failed with exit code: 256 <=====

Cause

Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms