开启闪回数据库
alter database flashback on;
alter database open;
修改日期时间显示格式:
alter session set nls_date_format='yyyy-mm-dd hh34: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 hh34: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 hh34: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 hh34: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;