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;


-------------运行Job-----------------------

begin

 dbms_job.run(41);

end;

你可能感兴趣的:(Oracle)