Oracle Job

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

-------------创建JOB-----------------
DECLARE
  X NUMBER;
BEGIN
  SYS.DBMS_JOB.SUBMIT
  ( job       => X
   ,what      => 'sumsaqty.get_placepoint_towweeksaqty;'
   ,next_date => to_date('30-10-2012 02:00:00','dd/mm/yyyy hh24:mi:ss')
   ,interval  => 'TRUNC(sysdate+1)+2/24'
   ,no_parse  => FALSE
  );
  SYS.DBMS_OUTPUT.PUT_LINE('Job Number is: ' || to_char(x));
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)