Scheduler Job Failes with "Incorrect function" error
632013Jul 23 2009 — edited Jul 27 2009hi experts,
This is 10.2.0.4 on Windows
I'm trying to build a simple little scheduler job to run an RMAN backup of my database. Not so easy for a newbie.
Somewhere I read that the job_action has to be Cmd.exe and your .bat file is specified in a job_argument, so that's what I've attempted to do - see below.
begin
dbms_scheduler.create_job('BACKUPWHOLE2',
job_action=>'C:\WINDOWS\SYSTEM32\CMD.EXE',
number_of_arguments=>3,
job_type=>'executable', enabled=>truee);
dbms_scheduler.set_job_argument_value('BACKUPWHOLE2',1,'/q');
dbms_scheduler.set_job_argument_value('BACKUPWHOLE2',2,'/c');
dbms_scheduler.set_job_argument_value('BACKUPWHOLE2',3,'C:\JobScripts\BackupWhole.bat');
dbms_scheduler.enable('BACKUPWHOLE2');
end;
/
The .bat file looks like this:
set oracle_sid=ultraprd;
rman connect target sys/pncl08UM@ultraprd @C:\JobScripts\BackupWhole.txt
The .txt file looks like this:
RUN {
Backup Database Plus Archivelog;
}
EXIT;
When I run the job it fails with
"ORA-27369 job of type EXECUTABLE failed with exit code: Incorrect function"
Sorry but I am totally lost.
Thanks, John