Oracle scheduled task interval

Source: Internet
Author: User

When defining an Oracle scheduled task, the interval is defined as the end time of a task to the start time of another task.

Example: select (TRUNC (sysdate, 'mi') + 1/(24*60), (sysdate + 1/(24*60) from dual

Error: sysdate + 1/(24*60) is used as the time interval. In this way, the current time is added when the next execution time is calculated, that is, the task execution time is added.

Correct: TRUNC (sysdate, 'mi') + 1/(24*60), and trunc is used to ignore the error of the current time (that is, the extra time of the task ). First of all, we need to have a consensus that the execution time of a task by minute cannot exceed one minute, and the execution time of a task by hour cannot exceed one hour, the execution time of daily tasks cannot exceed one hour. In this way, we can use trunc to boldly ignore the hour: TRUNC (sysdate, 'hh24') + 1/24, Day: TRUNC (sysdate, 'dd') + 1

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.