Oracle Timer Call Stored procedure

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.