数据库
首页 > 数据库> > Oracle DBMS_Jobs的创建

Oracle DBMS_Jobs的创建

作者:互联网

begin
  timer_auto_add_newpartitions('STN_AREASKHOURSRC','AREABG');
end;

begin
  timer_auto_add_newpartitions('STN_FIVEMINUTE','AREABG');
end;
begin
  timer_auto_add_newpartitions('STN_ONESECONDDATA','AREABG');
  end;
begin
  timer_auto_add_newpartitions('STN_STATEHOUR','AREABG');
  end;
begin
  timer_auto_add_newpartitions('STN_STATIONQCHOUR','AREABG');
  end;
begin
  timer_auto_add_newpartitions('STN_THIRTYSECONDDATA','AREABG');
  end;




declare jobno pls_integer; 

begin
  sys.dbms_job.submit(job => jobno,
                      what => 'timer_auto_add_newpartitions(''STN_AREASKHOURSRC'',''AREABG'');',
                      next_date => to_date('01-05-2021 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'TRUNC(LAST_DAY(SYSDATE))+1+1/24');
  commit;
end;




declare jobno pls_integer; 
begin
  sys.dbms_job.submit(job => jobno,
                      what => 'timer_auto_add_newpartitions(''STN_FIVEMINUTE'',''AREABG'');',
                      next_date => to_date('01-05-2021 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'TRUNC(LAST_DAY(SYSDATE))+1+1/24');
  commit;
end;

declare jobno pls_integer; 
begin
  sys.dbms_job.submit(job => jobno,
                      what => 'timer_auto_add_newpartitions(''STN_ONESECONDDATA'',''AREABG'');',
                      next_date => to_date('01-05-2021 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'TRUNC(LAST_DAY(SYSDATE))+1+1/24');
  commit;
end;

declare jobno pls_integer; 
begin
  sys.dbms_job.submit(job => jobno,
                      what => 'timer_auto_add_newpartitions(''STN_STATEHOUR'',''AREABG'');',
                      next_date => to_date('01-05-2021 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'TRUNC(LAST_DAY(SYSDATE))+1+1/24');
  commit;
end;


declare jobno pls_integer; 
begin
  sys.dbms_job.submit(job => jobno,
                      what => 'timer_auto_add_newpartitions(''STN_STATIONQCHOUR'',''AREABG'');',
                      next_date => to_date('01-05-2021 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'TRUNC(LAST_DAY(SYSDATE))+1+1/24');
  commit;
end;


declare jobno pls_integer; 
begin
  sys.dbms_job.submit(job => jobno,
                      what => 'timer_auto_add_newpartitions(''STN_THIRTYSECONDDATA'',''AREABG'');',
                      next_date => to_date('01-05-2021 00:00:00', 'dd-mm-yyyy hh24:mi:ss'),
                      interval => 'TRUNC(LAST_DAY(SYSDATE))+1+1/24');
  commit;
end;

 

标签:DBMS,Jobs,STN,00,date,add,Oracle,end,jobno
来源: https://www.cnblogs.com/vinsonLu/p/14723074.html