Oracle Job 的查询、创建、修改、删除

------------查询JOB-----------------
select job, what, next_date, next_sec, sysdate, failures, broken,interval
from user_jobs a;

-------------创建JOB-----------------
DECLARE job_country_warnRecord NUMBER;
  begin
  dbms_job.submit(job => job_country_warnRecord,
  what => 'WARNRECORD_PKG.proc_timerTask_warnRecord;',
  next_date => TRUNC(SYSDATE)+8/24,
  interval => 'TRUNC(sysdate) + 1 +8/(24)');
  commit;
end;

-------------修改JOB-----------------
begin
  dbms_job.change(62 ,job_country_warnRecord;', sysdate,'sysdate+2/(24*60)' );
  commit;
end;

begin
  dbms_job.change(62 ,job_country_warnRecord;', to_date('2011-08-01 22:00:00', 'yyyy-mm-dd hh24:mi:ss'),'sysdate+1');
  commit;
end;

-------------删除JOB-----------------
begin
 dbms_job.remove(41);  //41为Job 的ID值
end;

你可能感兴趣的:(Oracle Job 的查询、创建、修改、删除)