Automate a PL/SQL procedure [message #38020] |
Wed, 13 March 2002 16:56 |
Shantha Prasad
Messages: 2 Registered: March 2002
|
Junior Member |
|
|
Hi,
I have a PL/SQL procedure. This procedure needs to be executed automatically on the server at a regular interval of every 5 or 10 minutes. Can somebody give me a solution as to how this can be done? The OS that is being used is UNIX. Rather than the OS level, is it possible to manage this from ORACLE? Your help is greatly appreciated.
Thanks
Shantha
|
|
|
Re: Automate a PL/SQL procedure [message #38022 is a reply to message #38020] |
Wed, 13 March 2002 18:40 |
sokeh
Messages: 77 Registered: August 2000
|
Member |
|
|
You need a dbms_job package to automate the process.
something like this will probably survice:
--execute the following at sql prompt.
VARIABLE JOBNO NUMBER;
--next create the job
BEGIN
DBMS_JOB.SUBMIT(:jobno,'YourROCECDURE;', SYSDATE, 'SYSDATE + 10/(60*24)'); -- runs every 10 mins
COMMIT;
END;
/
|
|
|
|
Re: Automate a PL/SQL procedure [message #38031 is a reply to message #38020] |
Thu, 14 March 2002 06:53 |
Ravi
Messages: 251 Registered: June 1998
|
Senior Member |
|
|
if you want to check the running jobs,
select * from user_jobs;
To remove a running job, do the following by taking job_no from user_jobs table
exec dbms_job.remove(job_no);
|
|
|