首页 > 数据库 > Oracle > [oracle] oracle定时清理回收站
1.创建回收站清理的存储过程
create or replace procedure purge_recyclebin as
begin
execute immediate 'purge dba_recyclebin';
end;
/
2.创建定时任务
variable job number;
begin
dbms_job.submit(:job,'purge_recyclebin;',trunc(sysdate,'hh24'),'trunc(sysdate+7,''hh24'')');
commit;
end;
/
3.确认job
select * from dba_jobs;
4.修改定时任务
begin
dbms_job.next_date(1, sysdate);
end;
/
begin
dbms_job.interval(1, 'trunc(sysdate,''hh'')+24*7+12/24');
end;
/
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/69993564/viewspace-2761757/,如需转载,请注明出处,否则将追究法律责任。