oracle 表delete 通过闪回功能恢复数据

第一步:确定删除时间点,找出SCN,后面需要根据SCN让表闪回到这个SCN点的状态

select sysdate 时间, timestamp_to_scn(sysdate) SCN from dual;

 第二步:开启行移动功能,只有开启行移动功能才能对表做闪回

alter table TABLE_NAME enable row movement;

第三步:闪回数据

flashback table aaa to scn 6479990;

例外,查看闪回是设置时间

show parameter undo;
------------------------------------ ----------- ------------------------------
undo_management                      string      AUTO
undo_retention                       integer     900
undo_tablespace                      string      UNDOTBS1

900:单位秒,表示当前系统设置的闪回时间

可以通过修改默认的闪回时间

ALTER SYSTEM SET undo_retention=10800 SCOPE=BOTH;
 

猜你喜欢

转载自fxz-2008.iteye.com/blog/1753113