1、新增定时清理的存储过程内容如下:
CREATE OR REPLACE PROCEDURE "PROC_JOB_DEL_LOG" IS
del_date VARCHAR2(20) :=to_char(sysdate-2,'YYYY-MM-DD');--每天定时删除前一天日志信息
BEGIN
--log_ae86
insert into LOG_AE86_bak
(aaz343 ,
aab301 ,
aab299 ,
aaz341 ,
aae803 ,
aaa132 ,
aaz345 ,
aae899 ,
aae036 ,
aae011 ,
aae013 ,
aae186 ,
aae383 ,
aae140 ,
aac001 ,
aac002 ,
aac003 ,
aac004 ,
aae241
)
select aaz343 ,
aab301 ,
aab299 ,
aaz341 ,
aae803 ,
aaa132 ,
aaz345 ,
aae899 ,
aae036 ,
aae011 ,
aae013 ,
aae186 ,
aae383 ,
aae140 ,
aac001 ,
aac002 ,
aac003 ,
aac004 ,
aae241
from LOG_Ae86
where aaz343 in
(select count(aaz343)
from eventtb t
where to_char(t.starttime, 'YYYY-MM-DD') <= del_date);
--log_ae87
insert into log_ae87_bak
(aaz343 ,
aab301,
aaz341 ,
aae803 ,
aab299 ,
aac004 ,
aac003 ,
aac001 ,
aac002 ,
aaz345 ,
aae011 ,
aae036 ,
aae013 ,
aae186 ,
aae383 ,
aae899 ,
aae140 ,
aae241
)
select aaz343 ,
aab301,
aaz341 ,
aae803 ,
aab299