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.