A summary of the Oracle timer call stored procedures, if there is insufficient place, I hope that we have a lot of guidance, but also the first time in the blog to write something, before it was just a summary of the hard disk, and later colleagues told themselves, in fact, blogging can get a lot, whether it is knowledge experience or make friends, So is also holding a try mentality, hope to see this blog friend can help you, thank you. Don't say much nonsense, open spray.
1. Create a table to store the data:
CREATE TABLE job_table (run_time date);
2. Create a stored procedure:
Create or replace procedure Job_proc
Is
Begin
Insert into job_table (run_time) values (sysdate);
End;
3, create a timer (every minute, add a piece of data to the table)
Declare
Job number
Begin
Dbms_job.submit (Job, ' Job_proc; ', Sysdate, ' TRUNC (sysdate, ' mi ') +1/(24*60) ');
End;
4. View the created timer structure
Select Job, Next_date,next_sec,failures,broken
From User_jobs;
5. See if there is data in the created table (timer is started)
SELECT * from Job_table;
6. Start Timer (submit)
commit;
7, after a period of time to review, the table already has data, success;
8. Delete Timer
Delete from user_jobs where job = 41;
Note: Here is 41 refers to the number of the timer you created in step 5 o'clock, which you saw;
Oracle Timer Call Stored procedure