-- 测试表
select * from test order by id desc;
-- 存储过程
create or replace procedure myproc is
begin
insert into test(id) values (sysdate);
end;
/
--JOB
DECLARE
job1 number;
BEGIN
SYS.DBMS_JOB.SUBMIT
(
job => job1,
what => 'MYPROC;',
next_date => sysdate,
interval => 'sysdate+1/1440',
no_parse => FALSE
);
commit;
END;
/
--查看JOB
SELECT JOB, NEXT_DATE, NEXT_SEC, FAILURES, BROKEN FROM USER_JOBS;
--查看正运行的JOB
SELECT * from user_jobs;
-- 停止job(只能在命令行操作)
EXEC DBMS_JOB.broken(21,false);
--job如何唤醒还没有解决,目前的做法是重新建job;