确保oracle处于归档状态:
SQL> select log_mode,flashback_on from v$database;
配置参数db_recovery_file_dest、db_recovery_file_size:
SQL> alter system set db_recovery_file_dest='/home/oracle/app/oracle'; System altered. SQL> alter system set db_recovery_file_dest_size=16g; System altered. SQL> show parameter db_recovery_file NAME TYPE VALUE ------------------------------------ ----------- ------------------------------ db_recovery_file_dest string /home/oracle/app/oracle db_recovery_file_dest_size big integer 16G
开启闪回:
SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO SQL> alter database flashback on; Database altered. SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ YES
关闭闪回:
SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ YES SQL> alter database flashback off; Database altered. SQL> select flashback_on from v$database; FLASHBACK_ON ------------------ NO
如果是oracle 10g,开启和关闭闪回,需要将数据库至于mount状态:
shutdown immediate startup mount alter database flashback off; alter database open;