create or replace procedure RecoveryOfTable is
begin
declare
/***********************************************************************
select 'flashback table '||a.original_name||' to before drop' from
recyclebin a where a.operation = 'DROP' and a.type='TABLE'
恢复其它类型对象请将flashback table 这里换为其它类型,
type='相应的类型'可加更多条件限制,具体查询recyclebin
***********************************************************************/
cursor cur_flashback is select 'flashback table '||a.original_name||' to before drop' from
recyclebin a where a.operation = 'DROP' and a.type='TABLE';
v_name varchar2(4000);
begin
open cur_flashback;
fetch cur_flashback into v_name;
while cur_flashback%found
loop
execute immediate v_name;
fetch cur_flashback into v_name;
end loop;
dbms_output.put_line('恢复成功!');
close cur_flashback;
end;
end;
begin
RecoveryOfTable;
end;
还原被删除的表--批量版orcl
最新推荐文章于 2024-10-08 15:41:48 发布