ORACLE数据库创建定时任务 oracle定时器存储过程leveldual
程序员文章站
2024-03-26 13:07:59
...
创建存储器:
create or replace PRocedure pro_test
AS
BEGIN
insert into RAW_PERIOD_DATA(ertu_no,mp_no,data_time,code,data_flag)
select 1,level,sysdate,round(dbms_random.value(1,99),2),1 from dual connect by level<=148;
commit;
end pro_test;
创建定时任务:
declare
JOB_ILEARN_ONLINE number := 1;
begin
DBMS_JOB.SUBMIT(JOB_ILEARN_ONLINE,
'pro_test;',
SYSDATE, 'TRUNC(sysdate,''mi'') + 1 / (24*60)');
commit;
end;
查看所有的进程:
select job,next_date,next_sec,failures,broken from user_jobs;
可以关闭启动的定时任务:
begin
dbms_job.remove(4);
commit;
end;
create or replace PRocedure pro_test
AS
BEGIN
insert into RAW_PERIOD_DATA(ertu_no,mp_no,data_time,code,data_flag)
select 1,level,sysdate,round(dbms_random.value(1,99),2),1 from dual connect by level<=148;
commit;
end pro_test;
创建定时任务:
declare
JOB_ILEARN_ONLINE number := 1;
begin
DBMS_JOB.SUBMIT(JOB_ILEARN_ONLINE,
'pro_test;',
SYSDATE, 'TRUNC(sysdate,''mi'') + 1 / (24*60)');
commit;
end;
查看所有的进程:
select job,next_date,next_sec,failures,broken from user_jobs;
可以关闭启动的定时任务:
begin
dbms_job.remove(4);
commit;
end;