首页 > 数据库技术 > 详细

利用闪回查看oracle表历史时刻数据

时间:2014-09-18 03:12:33      阅读:322      评论:0      收藏:0      [点我收藏+]

 

1.查看表历史时刻数据

select * from tab_test AS OF TIMESTAMP to_timestamp(‘20140917 10:00:00‘,‘yyyymmdd hh24:mi:ss‘);

 

2、利用flashback table恢复表到过去某一时刻

alter table tab_test enable row movement; 
flashback table tab_test to timestamp (‘20140917 10:00:00‘,‘yyyymmdd hh24:mi:ss‘);
alter table tab_test disable row movement;

 

3、查看过去某一段时间内对表的操作,以确认需要恢复到的时间点

select SQL_TEXT,LAST_ACTIVE_TIME from v$sqlarea where LAST_ACTIVE_TIME >to_date(‘20140917 10:00:00‘,‘yyyymmdd hh24:mi:ss‘) and SQL_TEXT like ‘%tab_test%‘;

 

4、确认是否开启闪回

select log_mode,flashback_on from v$database;

本文出自 “composer” 博客,请务必保留此出处http://zuoqujia.blog.51cto.com/9151800/1554527

利用闪回查看oracle表历史时刻数据

原文:http://zuoqujia.blog.51cto.com/9151800/1554527

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!