ORA-27369: job of type EXECUTABLE failed with exit code: Incorrect function.
I tried to execute the batch file through the Database Scheduler on the Windows platform and am getting the following error as shown in the 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 well while executing from cmd windows.
C:\Users\oracle> D:\rundiskinfo.batC:\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 located directly on the D: drive. I changed 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