FLASHBACK实施笔记

简介:
一、启用FLASHBACK
1、更改参数(在6节点执行如下脚本)
shutdown immediate;
startup mount;
alter system set db_recovery_file_dest_size=4G scope=both;
alter system set db_recovery_file_dest='/home/oracle/archlog' scope=both;
alter database flashback on;
alter database open;


2、确认
是否启用闪回
select FLASHBACK_ON from v$database;
闪回恢复区的内容
select file_type from v$flash_recovery_area_usage;
其他参数
show parameter DB_FLASHBACK_RETENTION_TARGET;
show parameter DB_RECOVERY_FILE_DEST_SIZE;
show parameter DB_RECOVERY_FILE_DEST;

3、记录脚本执行前SYSDATE
select to_char(sysdate, 'yyyy-mm-dd hh24:mi:ss') from dual;

4、表启用ROW MOVEMENT
ALTER TABLE INDUSTRY testflashback ROW MOVEMENT;


5、测试闪回(testflashback表)
select Count(*) from testflashback t;
COUNT(*)
5
delete from testflashback;
commit;
flashback table testflashback to timestamp to_date('2012-11-30 22:00:00','yyyy-mm-dd hh24:mi:ss');
select Count(*) from testflashback t;
COUNT(*)


二、关闭FLASHBACK
shutdown immediate;
startup mount;
alter database flashback off;
alter database open;
alter system set db_recovery_file_dest='' scope=both;
 

本文转自zylhsy 51CTO博客,原文链接:http://blog.51cto.com/yunlongzheng/1075458,如需转载请自行联系原作者
相关文章