ITPub博客

首页 > 数据库 > Oracle > 利用闪回查看oracle表历史时刻数据

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

Oracle 作者:panqiong12345 时间:2017-09-21 17:10:30 0 删除 编辑

原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://zuoqujia.blog.51cto.com/9151800/1554527
 
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

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/29050044/viewspace-2145287/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2014-05-09

  • 博文量
    138
  • 访问量
    87003