1. 查看数据库是否是归档模式:

SQL> show parameter db_flashback;


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

db_flashback_retention_target        integer     1440

SQL> archive log list;

Database log mode              Archive Mode

Automatic archival             Enabled

Archive destination            /oradata/arch/matrixdg

Oldest online log sequence     65

Next log sequence to archive   0

Current log sequence           67


2.设置闪回参数:

SQL> show parameter db_recovery;


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

db_recovery_file_dest                string      /u2/oracle/fast_recovery_area

db_recovery_file_dest_size           big integer 4122M

如上:db_recovery_file_dest为闪回路径,db_recovery_file_dest_size为闪回区大小。


SQL> show parameter flashback;


NAME                                 TYPE        VALUE

------------------------------------ ----------- ------------------------------

db_flashback_retention_target        integer     1440

如:db_flashback_retention_target闪回保留时间


3.关闭数据库,启用闪回

SQL>shutdown immediate

SQL>startup mount

SQL>alter database flashback on;

SQL>alter database open;


4.查询闪回状态

SQL> select flashback_on from v$database;


FLASHBACK_ON

------------------

YES