--闪回权限
grant flashback any table to scott;
--闪回 update,delete,insert
update tab2 set empno=0;
delete from tab2 where deptno=20;
insert into tab2 select * from emp;
select * from tab2;
--执行以下命令
alter table tab2 enable row movement;
flashback table tab2 to timestamp (systimestamp - interval '13' minute); --'13' 13分钟前
--drop 表删除闪回
drop table tab4;
--登录sqlplus/命令行 执行以下命令;
show recyclebin; --pl/sql 查看无数据不妨碍闪回
FLASHBACK TABLE tab4 TO BEFORE DROP;
flashback table "BIN$LLsXwM6MQyqrWg+3RzoqVQ==$0" to before drop; --通过回收站里的表名闪回
--闪回重名的表
create table tab4 as select * from emp ;
drop table tab4;
create table tab4 as select * from tab2;
drop table tab4;
show recyclebin ; --此时回收站应有两张tab4表
flashback table tab4 to before drop; --闪回最后删除的表
flashback table tab4 to before drop rename to tab5 ;-- 若要闪回另一张表需要重命名
grant flashback any table to scott;
--闪回 update,delete,insert
update tab2 set empno=0;
delete from tab2 where deptno=20;
insert into tab2 select * from emp;
select * from tab2;
--执行以下命令
alter table tab2 enable row movement;
flashback table tab2 to timestamp (systimestamp - interval '13' minute); --'13' 13分钟前
--drop 表删除闪回
drop table tab4;
--登录sqlplus/命令行 执行以下命令;
show recyclebin; --pl/sql 查看无数据不妨碍闪回
FLASHBACK TABLE tab4 TO BEFORE DROP;
flashback table "BIN$LLsXwM6MQyqrWg+3RzoqVQ==$0" to before drop; --通过回收站里的表名闪回
--闪回重名的表
create table tab4 as select * from emp ;
drop table tab4;
create table tab4 as select * from tab2;
drop table tab4;
show recyclebin ; --此时回收站应有两张tab4表
flashback table tab4 to before drop; --闪回最后删除的表
flashback table tab4 to before drop rename to tab5 ;-- 若要闪回另一张表需要重命名