I had an issue with DBMS_SCHEDULER in oracle.I have an external programme(a perl script residing on the server on which oracle is running) which I want to run from my stored procedure based on certain condition.So for that I learned that an external program can be run by creating DBMS_SCHEDULER.create_program.So I did only that.Now the issue,I have a program object created in oracle and but I am unable to execute this object.I have been trying some thing like this to run this object:
EXECUTE MY_PROGRAM_OBJECT;
But every time I do this it is saying that object MY_PROGRAM_OBJECT is invalid(FYI…I can see this object using select * from ALL_OBJECTS).Now I sincerely think that there must be some other way to run this.unfortunately,I don’t seem to find any formal doc. for a running a crated Program object.Now can u plz advice me how it needs to be executed?Is it that for executing I have to create another job and point it from there,for which I dont see any rational.
P.S. I have got execute permission on DBMS_SCHEDULER.
All the help in this regard will be appreciated.
Lots of thanks,for taking out the time!
You should create a job that uses the program you created. Something like:
Note that the schedule ‘INTERVAL_EVERY_DAY’ would need to be created via dbms_scheduler.create_schedule.
To run or stop manually, you can use dbms_scheduler.run_job and dbms_scheduler.stop_job. Use dba_scheduler_jobs to view the status of the job you just created above.
As for the rationale for creating programs, they help you to create more complex situations involving chains of jobs. You would define your chain steps to point to programs and define rules on how to proceed through the chain (running steps concurrently or sequentially in defined order).