ORACLE-005: Create Job (a)

Source: Internet
Author: User

The job is actually in use. Use very much. The general user periodically runs certain functions, stored procedures, and so on.

Here's a look at how to create and start a job.

For example, a stored procedure is run with a job schedule.

Stored Procedure name: Pro_test_job

Operating interval: 2 hours,

SQL statements such as the following

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 a few main parameters to illustrate.

Job-refers to the job ID, which is generated by itself.
The content of the what-job. Assume that a job with a number of parameters can be a script here.

Next_date-the next run time.

interval-operating frequency.

Here is the job without a reference, assuming that you need to enter a number of parameters how to write SQL, please see the next article.

ORACLE-005: Create Job (a)

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.