Home » SQL & PL/SQL » SQL & PL/SQL » Automate a PL/SQL procedure
Automate a PL/SQL procedure [message #38020] Wed, 13 March 2002 16:56 Go to next message
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 Go to previous messageGo to next message
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 #38024 is a reply to message #38022] Wed, 13 March 2002 21:27 Go to previous messageGo to next message
Shantha Prasad
Messages: 2
Registered: March 2002
Junior Member
Thank you very much. The solution has really been very helpful
Re: Automate a PL/SQL procedure [message #38031 is a reply to message #38020] Thu, 14 March 2002 06:53 Go to previous message
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);
Previous Topic: Can one pass a column name as a parameter to a procedure
Next Topic: Java test tool
Goto Forum:
  


Current Time: Thu Apr 25 03:31:44 CDT 2024