Declare
Jobno number;
Begin
Dbms_job.submit (
Jobno,
' P_dosomething; ',--what
To_date (' 20090101020000 ', ' yyyy-mm-dd hh24:mi:ss '),--next_date, can not be filled
Interval = ' TRUNC (sysdate) + 1 +2/(+) '--' Interval time string '--interval, key settings
);
Commit
End
1. Execute Every Minute
Interval = TRUNC (sysdate, ' mi ') + 1/(24*60)
2, daily scheduled execution
Example: Daily 2 o'clock in the morning execution
Interval = TRUNC (sysdate) + 1 +2/(24)
3. Regular weekly execution
For example: Every Monday 2 o'clock in the morning execution
Interval = TRUNC (Next_day (sysdate, 2)) +2/24--Monday, the second day of the week
4. Regular monthly execution
For example: 1st 2 o'clock in the morning every month to execute
Interval =>trunc (Last_day (sysdate)) +1+2/24
5, quarterly scheduled execution
For example, the first day of each quarter is 2 o'clock in the morning execution
Interval = TRUNC (add_months (sysdate, 3), ' Q ') + 2/24
6, every half-yearly scheduled execution
For example: Every July 1 and January 1 2 o'clock in the morning
Interval = Add_months (trunc (sysdate, ' yyyy '), 6) +2/24
7. Scheduled execution every year
For example: January 1 2 o'clock in the morning every year to execute
Interval =>add_months (trunc (sysdate, ' yyyy '), 12) +2/24
Of course, the above list is impossible to take care of all aspects, but a little change, you can derive countless examples, smart you will certainly, I am not much wordy here.
Oracle fixed value execution stored procedure