1.创建一个测试表test
create table test(time date);
2.创建一个存储过程
create or replace procedure test as
begin
insert into test values(sysdate);
end;
3.定时任务样板
declare
job1 number;
begin
dbms_job.submit(job1,
what => ‘test;’,
next_date => sysdate,
interval => ‘sysdate+1/(246060)’); – 每隔1s处理一次用户表
commit;
end;
4.查询定时任务
select job,broken,what,interval,t.* from user_jobs t;