ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
I tried to execute the batch file through Database scheduler in windows platform and getting the following error as show in example:
SQL> Begin
DBMS_SCHEDULER.CREATE_JOB(JOB_NAME => 'DISKINFO_JOB',
JOB_TYPE => 'EXECUTABLE',
JOB_ACTION =>'D:\rundiskinfo.bat',
START_DATE => SYSDATE +1/24/59,
REPEAT_INTERVAL => 'FREQ=DAILY;BYHOUR=15;BYMINUTE=31;',
enabled => TRUE);
END;
/
PL/SQL procedure successfully completed.
SQL> exec dbms_scheduler.run_job('DISKINFO_JOB');
BEGIN dbms_scheduler.run_job('DISKINFO_JOB'); END;
*
ERROR at line 1:
ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
ORA-06512: at "SYS.DBMS_ISCHED", line 185
ORA-06512: at "SYS.DBMS_SCHEDULER", line 486
ORA-06512: at line 1
Solution:
1. Check that your job is working good while executing from cmd windows.
C:\Users\oracle> D:\rundiskinfo.bat
C:\Users\oracle>D:\scripts\diskinfo.bat localhost 1>D:\diskinfo.csv
'D:\scripts\diskinfo.bat' is not recognized as an internal or external command,
operable program or batch file.
2. Correct the path of scripts and check again.
Note: My script is present directly in D: drive. I change them.
-- Now script is running fine.
C:\Users\oracle>D:\rundiskinfo.bat
C:\Users\oracle>D:\diskinfo.bat localhost 1>D:\diskinfo.csv
C:\Users\oracle>
3. Then again try to run the DISKINFO_JOB created in DBMS Scheduler
SQL> exec dbms_scheduler.run_job('DISKINFO_JOB');
PL/SQL procedure successfully completed.
Note: It running successfully