Avi
Avi

Reputation: 1145

Scheduling Job oracle 10g

I have an procedure inside a package which i have to run everyday manualy. how to make it done by oracle automaticaly in oracle 10g.

There are 3 inputs(2 nos,1 varchar) and one output(varchar) of the executing procedure

Inputs values will remain same for me,but in case i have to change it wat do I do. can anybody explain me with easy examples.

Thanks Avi

Upvotes: 1

Views: 194

Answers (2)

Ocean's61
Ocean's61

Reputation: 11

You can use DBMS_JOB.iSubmit function like the following.

BEGIN 
DBMS_JOB.isubmit ( job => 61, 
                   what => 'YOUR_PROCEDURE;', 
                   next_date => to_date('03.10.2014 00:30:00','dd.MM.yyyy HH24:Mi:ss'), -- start now         INTERVAL => 'sysdate + 1' -- Run every day ); 
COMMIT; 
END;

JOB: You can use an ID which has not been used in user_jobs. You can check them with the following query.

select * from user_jobs; 

What: The name of your procedure with ";" at the end. Next_date: The time you want your job to be run. Interval: The period of your job. Should be 'sysdate+1' for everyday.

You can remove it with the script below:

begin DBMS_JOB.REMOVE(JOB => 61); end;

Upvotes: 1

Nagh
Nagh

Reputation: 1804

Take a look at dbms_job package. Its easy to use and does what you need.

Upvotes: 2

Related Questions