创建一个定时调度作业
自动生成调度作业的代码
create or replace
package body WWOHIN is
--Daily refresh (01:00)
procedure DAILY_REFRESH_0 is
ALL_START_DT DATE;
START_DT DATE;
JOB_NAME varchar2(100);
RUNNING_DATE varchar2(30);
SEQ_NUM number(15);
begin
ALL_START_DT := sysdate;
JOB_NAME := 'DAILY_REFRESH_0';
RUNNING_DATE := to_char(sysdate, 'yyyy-MM-dd');
SEQ_NUM := (sysdate - to_date('1970-1-1', 'yyyy-mm-dd')) * 86400 -
TO_NUMBER(SUBSTR(TZ_OFFSET(sessiontimezone), 1, 3)) * 3600;
START_DT := sysdate;
WMAL.MALAYSIA_KPI_DATE_UPDATE_DAILY;
W_JOB_FILE_LOG_P(job => JOB_NAME,
step => 'WMAL.MALAYSIA_KPI_DATE_UPDATE_DAILY',
start_dt => START_DT,
finish_dt => sysdate,
RUNNING_D => RUNNING_DATE,
SEQ_NUM => SEQ_NUM);
-- 写入整个Job时间
W_JOB_FILE_LOG_P(job => JOB_NAME,
step => 'ALL',
start_dt => ALL_START_DT,
finish_dt => sysdate,
RUNNING_D => RUNNING_DATE,
SEQ_NUM => SEQ_NUM);
end;