oracle JOB 查询 添加 修改 删除

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

-------------添加JOB-----------------
variable n number;

begin
  dbms_job.submit(:n, 'MY_JOP;', sysdate,'sysdate+2/(24*60*60)');
  commit;
end;

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

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


-------------删除JOB-----------------
begin
 dbms_job.remove(41);
end;

 

posted @ 2013-11-14 11:27  十二十二  阅读(671)  评论(0编辑  收藏  举报