oracle以其账号登陆命令oracle表delete通过闪回功能恢复数据

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

 

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

   www.2cto.com  

Sql代码  

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

 

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

 

Sql代码  

alter table TABLE_NAME enable roworacle账号 movement;  

 

第三步:闪回数据

 

Sql代码  

flashback table aaa to scn 6479990;  

 

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

   www.2cto.com  

Sql代码  

show parameter undo;  

 

Java代码  

———————————— ———– ——————————  

undo_management                      string      AUTO  

undo_retention                       integer     900  

undo_tablespace                      string      UNDOTBS1  

 

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

 

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

 

Sql代码  

ALTER SYSTEM SET undo_retention=10800 SCOPE=BOTH;

 

此条目发表在oracle metalink账号分类目录,贴了标签。将固定链接加入收藏夹。