Home » RDBMS Server » Backup & Recovery » Execute BATCH FILE through PLSQL (oracle, 10g, windows xp)
Execute BATCH FILE through PLSQL [message #555996] Wed, 30 May 2012 08:44 Go to next message
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 #555998 is a reply to message #555996] Wed, 30 May 2012 08:48 Go to previous messageGo to next message
Michel Cadot
Messages: 68625
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator
Already asked and asked and asked, please search for the solutions and come back if none works for you.

Of course with the proof they do not work.

Regards
Michel

[Updated on: Wed, 30 May 2012 08:49]

Report message to a moderator

Re: Execute BATCH FILE through PLSQL [message #556042 is a reply to message #555998] Wed, 30 May 2012 13:45 Go to previous message
Littlefoot
Messages: 21806
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!
Previous Topic: Scheduler on Particular Condition
Next Topic: Rman catalog
Goto Forum:
  


Current Time: Fri Mar 29 00:48:11 CDT 2024