Application of Oracle timer and Oracle Timer

Source: Internet
Author: User

Application of Oracle timer and Oracle Timer

Oracle timer. Once set, the restart of the server will not affect the execution of the Oracle timer (scheduled to be executed every day ),

Begin sys. dbms_job.submit (job =>: job, what => 'check _ err; ', next_date => trunc (sysdate) + 23/24, interval => 'trunc (next_day (sysdate, ''friday'') + 23/24 '); commit; end;
Job is a process or function automatically generated by the system, and check_err is a process or function. next_date is used to set the next execution time. Here is the interval set for interval at this evening, this is on Friday every week. The function next_day returns the date containing the specified character. The trunc function removes the time in the date, that is, the of a day, the time is in the unit of days. Therefore, if you want to score a certain point, you need the score:


1. Execute Interval => TRUNC (sysdate, 'mi') + 1/(24*60) per minute. 2. perform the following operations on a daily basis: execute Interval => TRUNC (sysdate) + 1 + 2/(24) at every day. 3. Perform scheduled execution on a weekly basis, for example: execute Interval => TRUNC (next_day (sysdate, 'monday') + 2/244 at every Monday. The scheduled monthly execution is as follows: execute Interval => TRUNC (LAST_DAY (SYSDATE) at on the first day of every month )) + 1 + 2/245. Periodical execution on a quarterly basis. For example, Interval => TRUNC (ADD_MONTHS (SYSDATE, 3), 'q') is executed at on the first day of each quarter ') + 2/246. Periodical execution every six months. For example, the annual scheduled execution is performed at Interval => ADD_MONTHS (trunc (sysdate, 'yyyy'), 6) + 2/247. For example: execute Interval => ADD_MONTHS (trunc (sysdate, 'yyyy'), 6) + 2/24 at every year.

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.