日期:2014-05-16  浏览次数:20530 次

Oracle Schedular Job 设置Repeat Interval

?? 设置Repeat Interval??
  Job 和Schedule中REPEAT_INTERVAL参数都是用来控制执行的频率或周期,虽然说周期是一个时间性概念,不过REPEAT_INTERVAL指定的时候并不是一个时间值,而是由一组关键字描述的时间。??
?
  除了前面介绍Job和Schedule的REPEAT_INTERVAL参数时,提到该参数拥有FREQ以及INTERVAL两个关键字,其实除此之外,还有如BYMONTH、BYWEEKNO、BYYEARDAY、BYDATE等等参数,可以用来进行更精确的定义,比如通过BYMONTH关键字指定调度运行的月份,BYDAY指定调度在哪天运行等等。??
?
  REPEAT_INTERVAL 参数的详细语法如下:??
?
?? repeat_interval = regular_schedule | combined_schedule??
??
?==============================??
??
regular_schedule = frequency_clause??
?
[";" interval_clause] [";" bymonth_clause] [";" byweekno_clause]??
?
[";" byyearday_clause] [";" bydate_clause] [";" bymonthday_clause]??
?
[";" byday_clause] [";" byhour_clause] [";" byminute_clause]??
?
[";" bysecond_clause] [";" bysetpos_clause] [";" include_clause]??
?
[";" exclude_clause] [";" intersect_clause][";" periods_clause]??
?
[";" byperiod_clause]??
?
==============================????
?
combined_schedule = schedule_list [";" include_clause]??
?
[";" exclude_clause] [";" intersect_clause]??
?
frequency_clause = "FREQ" "=" ( predefined_frequency | user_defined_frequency )??
?
predefined_frequency = "YEARLY" | "MONTHLY" | "WEEKLY" | "DAILY" |???
?
?? "HOURLY" | "MINUTELY" | "SECONDLY"?
?
user_defined_frequency = named_schedule??
?
==============================??
?
interval_clause = "INTERVAL" "=" intervalnum??
?
?? intervalnum = 1 through 99??
?
bymonth_clause = "BYMONTH" "=" monthlist??
?
?? monthlist = monthday ( "," monthday)*??
?
?? month = numeric_month | char_month??
?
?? numeric_month = 1 | 2 | 3 ...? 12??
?
?? char_month = "JAN" | "FEB" | "MAR" | "APR" | "MAY" | "JUN" |??
?
?? "JUL" | "AUG" | "SEP" | "OCT" | "NOV" | "DEC"?
?
byweekno_clause = "BYWEEKNO" "=" weeknumber_list??
?
?? weeknumber_list = weeknumber ( "," weeknumber)*??
?
?? weeknumber = [minus] weekno??
?
?? weekno = 1 through 53??
?
byyearday_clause = "BYYEARDAY" "=" yearday_list??
?
?? yearday_list = yearday ( "," yearday)*??
?
?? yearday = [minus] yeardaynum??
?
?? yeardaynum = 1 through 366??
?
bydate_clause = "BYDATE" "=" date_list??
?
?? date_list = date ( "," date)*??
?
?? date = [YYYY]MMDD [ offset | span ]??
?
bymonthday_clause = "BYMONTHDAY" "=" monthday_list??
?
?? monthday_list = monthday ( "," monthday)*??
?
?? monthday = [minus] monthdaynum??
?
?? monthdaynum = 1 through 31??
?
byday_clause = "BYDAY" "=" byday_list??
?
?? byday_list = byday ( "," byday)*??
?
?? byday = [weekdaynum] day??
?
?? weekdaynum = [minus] daynum??
?
?? daynum = 1 through 53 /* if frequency is yearly */?
?
?? daynum = 1 through 5? /* if frequency is monthly */?
?
?? day = "MON" | "TUE" | "WED" | "THU" | "FRI" | "SAT" | "SUN"?
?
byhour_clause = "BYHOUR" "=" hour_list??
?
?? hour_list = hour ( "," hour)*??
?
?? hour = 0 through 23??
?
byminute_clause = "BYMINUTE" "=" minute_list??
?
?? minute_list = minute ( "," minute)*??
?
?? minute = 0 through 59??
?
bysecond_clause = "BYSECOND" "=" second_list??
?
?? second_list = second ( "," second)*??
?
?? second = 0 through 59??
?
bysetpos_clause = "BYSETPOS" "=" setpos_list??
?
?? setpos_list = setpos ("," setpos)*??
?
?? setpos = [minus] setpos_num??
?
?? setpos_num = 1 through 9999??
?
==============================??
?
include_clause = "INCLUDE" "=" schedule_list??
?
exclude_clause = "EXCLUDE" "=" schedule_list??
?
intersect_clause = "INTERSECT" "=" schedule_list??
?
schedule_list = schedule_clause ("," schedule_clause)*??
?
schedule_clause = named_schedul