首页 > 数据库技术 > 详细

oracle闪回那些事

时间:2014-11-11 02:03:23      阅读:376      评论:0      收藏:0      [点我收藏+]

开启闪回数据库

alter database flashback on;

alter database open;

修改日期时间显示格式:

alter session  set nls_date_format=‘yyyy-mm-dd hh24:mi:ss‘;

查看系统视图 v$flashback_database_log中查看闪回数据库日志信息:

select * from v$flashback_database_log;

闪回数据库:

flashback database to timestamp(to_date(‘2014-10-11 12:20:11‘,‘yyyy-mm-dd hh24:mi:ss‘));

闪回恢复后需要resetlogs 或者noresetlogs 打开:

alter database open resetlogs/noresetlogs;

闪回表:

flashback table tablename to timestamp(to_date(‘2014-11-10 12:12:12‘,‘yyyy-mm-dd hh24:mi:ss‘));

闪回回收站:

flashback table tablename to before drop;

删除回收站中的数据可以使用以下命令:;

purge table tablename;

清空回收站:

purge dba_recyclebin;

闪回查询:

select * from tablename as of timestamp to timestamp(to_date(‘2014-11-12 10:10:10‘,‘yyyy-mm-dd hh24:mi:ss‘)) where ....;

闪回版本查询:

select versions_starttime,version_operation,name,score from tablename versions between timestamp minvalue and maxvalue;

闪回事务查询:

select table_name,undo_sql from flashback_tracsaction_query where rownum<5;


本文出自 “积累中成长” 博客,请务必保留此出处http://5200644.blog.51cto.com/5190644/1575173

oracle闪回那些事

原文:http://5200644.blog.51cto.com/5190644/1575173

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