Scheduled Oracle job execution

Source: Internet
Author: User

Periodically execute Oracle job tasks to create a data table and create a process so that the process runs once a minute. 1) create a table. SQL> create table test (mydate date); Table created. (2) create a custom process. Www.2cto.com SQL> create or replace procedure proc_test as 2 BEGIN 3 insert into test values (sysdate); 4 END; 5/Procedure created. (3) create a JOB. SQL> var job numberSQL> var job number; -- run the test process once every 1440 minutes every day at www.2cto.com SQL> begin 2 dbms_job.submit (: job, 'proc _ test; ', sysdate, 'sysdate + 100'); 3 END; 4/PL/SQL procedure successfully completed. (4) run the JOB. SQL> BEGIN 2 dbms_job.run (: job); 3 END; 4/PL/SQL procedure successfully completed. (5) Check whether JOBSQL> SELECT to_char (mydate, 'yyyy/mm/dd hh24: mi: ss') insertedtime FROM test is regularly executed; INSERTEDTIME-------------------2013/01/24 04:39:08/01/24/01/24/172013/01 delete a JOB. SQL> begin 2 dbms_job.remove (: job); 3 END; 4/PL/SQL procedure successfully completed.

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.