Oracle job learning

Source: Internet
Author: User

Oracle job

Execute the following script in plsql to create a job that is executed at every night.

Begin

Sys. dbms_job.submit (job =>: job, -- job ID

What => 'dbms _ output. pub_line (''asdf ''); ', -- execute the script

Next_date => to_date ('17-01-2011 16:17:31 ', 'dd-mm-yyyy hh24: mi: ss'), -- next execution time

Interval => 'trunc (sysdate) + 100'); -- execution interval

Commit;

End;

The following example shows the possible values of the interval parameter:

A. Run the command every 5 minutes.

Interval => 'trunc (sysdate, 'mi ') + 5/24/60'

B. Run the command once every hour.

Interval => 'trunc (sysdate, 'hh') + 100'

C. Execution in one hour

Interval => 'sysdate + 123'

For more information about Oracle, see Oracle topics page http://www.bkjia.com/topicnews.aspx? Tid = 12

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.