Execute BATCH FILE through PLSQL [message #555996] |
Wed, 30 May 2012 08:44 |
muktha_22
Messages: 527 Registered: December 2009
|
Senior Member |
|
|
Hi All,
Kindly guide me to execute a BATCH File through PLSQL.
BEGIN
dbms_scheduler.Create_schedule(schedule_name => 'RMAN_TICKER_STARTING',
repeat_interval => 'FREQ=DAILY;BYHOUR=9; BYMINUTE=15,30,45,59',
comments
=> 'schedule to run daily');
dbms_scheduler.Create_program (program_name => 'TICKER_PROGRAME',
program_type => 'EXECUTABLE',
program_action => 'F:\FEEDLGR\TOOLS\bfeedlgr.cmd >nul', enabled => TRUE,
comments => 'This programe to be used to run the Rmans Ticker');
dbms_scheduler.Create_job (job_name => 'RMAN_TICKER_JOB',
program_name => 'TICKER_PROGRAME', schedule_name => 'RMAN_TICKER_STARTING',
enabled => TRUE, comments => 'For Running Ticker');
END;
It was created successfully, but when I execute, it shows the error message.
BEGIN
dbms_scheduler.Run_job ('RMAN_TICKER_JOB', TRUE);
END;
begin
dbms_scheduler.run_job (
'RMAN_TICKER_JOB',TRUE);
end;
Error at line 1
ORA-27370: job slave failed to launch a job of type EXECUTABLE
ORA-27300: OS system dependent operation:accessing execution agent failed with status: 2
ORA-27301: OS failure message: The system cannot find the file specified.
ORA-27302: failure occurred at: sjsec 6a
ORA-27303: additional information: The system cannot find the file specified.
ORA-06512: at "SYS.DBMS_ISCHED", line 150
ORA-06512: at "SYS.DBMS_SCHEDULER", line 441
ORA-06512: at line 2
But I have the CMD file in the location - "F:\FEEDLGR\TOOLS\bfeedlgr.cmd".
Kindly help me out.
Muktha
|
|
|
|
Re: Execute BATCH FILE through PLSQL [message #556042 is a reply to message #555998] |
Wed, 30 May 2012 13:45 |
|
Littlefoot
Messages: 21823 Registered: June 2005 Location: Croatia, Europe
|
Senior Member Account Moderator |
|
|
I'm repeating myself, I know, but it seems that you either didn't read what's already being said or you didn't understand it.
When I said "CMD", I meant "CMD.EXE" (Windows' command interpreter). It is that black window that opens when you click "C:\" black "Command Prompt" icon, which enables you to use keyboard and run certain commands, instead of utilizing your mouse device.
As far as I can tell (which doesn't have to be correct, but that's what I learnt when scheduling external programs), you need to call CMD.EXE (by default, it is - in recent MS Windows operating systems - located in C:\Windows\System32 directory). Scheduler then needs to provide arguments to it. One of them will be your F:\FEEDLGR\TOOLS\bfeedlgr.cmd file.
So, read your previous topic. Then follow link(s) Barbara and me provided to a topic I opened some time ago and read it carefully. I hope you'll manage to make it work. Best of luck!
|
|
|