Oracle timed task instance. ____oracle

Source: Internet
Author: User

1. Create test table and serial number

[SQL] view plain copy print? CREATE TABLE Job_test (ID integer,add_time date);

SQL] View Plaincopyprint?

Create sequence seq_tm_id
MinValue 1
MaxValue 99999
Start with 61
Increment by 1
Cache 20; 2, the creation process

[SQL] view plain copy print?     Create or replace procedure Prc_job_test is begin inserts into job_test values (Seq_tm_id.nextval, sysdate);   Commit   End Prc_job_test; 3. Create a task

[SQL] view plain copy print?   declare tm_job number; Begin Sys.dbms_job.submit (Tm_job,--Task name ' prc_job_test; ',--the process of execution SYSD   Ate,--Execution Time ' sysdate+1/(24*60*10) ');--Next execution time end; 4. View task ID

[SQL] view plain copy print?   SELECT * from Dba_jobs; 5. Perform the task

[SQL] view plain copy print?    Begin Dbms_job.run (41);--41 is the ID end of the task; 6, delete the task

[SQL] view plain copy print?   Begin Dbms_job.remove (41); End

Related Article

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.