0
点赞
收藏
分享

微信扫一扫

小小闪回flashback


 

不小心把t_user表里的几条数据都删掉了。

这几天数据是有用的。怎么办呀

幸亏有flashback,太方便了

SQL> select dbms_flashback.get_system_change_number c_SCN from dual;
查看当前scn号。

也可以通过
SQL> select current_scn from v$database;
查看

根据最后的scn不断的用前面的scn来试探

SQL>select * from t_user as of scn &scn where name=’zhangjinsan’;
直到确切需要恢复的scn号。

比如这里是1391833

SQL>alter table t_user enable row movement;

SQL>flashback table t_user to scn 1391833;

检查数据已经返回
SQL>select * from t_user where name=’peseidon’;

 

===============================================================

Inthirties关注Oracle数据库 维护,优化,安全,备份,恢复,迁移,故障处理

 


举报

相关推荐

0 条评论