ORACLE-005: create JOB (1), oracle005 create job

Source: Internet
Author: User

ORACLE-005: create JOB (1), oracle005 create job

Jobs are widely used in practical applications. Generally, you can regularly execute certain functions and stored procedures. The following describes how to create and start a JOB.

For example, you can use a job to regularly execute a stored procedure.

Stored Procedure name: Pro_Test_JOB

Execution interval: 2 hours,

The SQL statement is as follows:

Declare job number; v_count number; begin select count (*) INTO v_count FROM user_jobs uj WHERE upper (uj. what) = UPPER ('Pro _ Test_JOB; '); if v_count = 0 then sys. dbms_job.submit (job => job, what => 'Pro _ Test_JOB; ', next_date => sysdate, interval => 'sysdate + 2/24'); dbms_job.run (job); commit; end if; end;

Here are several main parameters to describe.

Job-is the ID of the JOB, which is automatically generated.
What-job content. If a job with parameters is included, a script is provided here.

Next_date-next execution time.

Interval-execution frequency.

Here is a job without parameters. If you need to enter parameters to write SQL statements, read the next article.

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.