开启回闪进行测试:
确认数据库是否打开了flashback的方法:
SQL> select name,log_mode,flashback_on from v$database;
NAME LOG_MODE FLASHBACK_ON
--------- ------------ ------------------
ORA11G ARCHIVELOG NO --> flashback未打开
确定flashback的存储路径
SQL> show parameter recovery
NAME TYPE VALUE
----------------------------- ----------- ------------------------------
db_recovery_file_dest string
db_recovery_file_dest_size big integer 0
SQL>alter system set db_recovery_file_dest_size=20G scope=both;
System altered.
SQL> show parameter recovery
NAME TYPE VALUE
------------------------------- ----------- ------------------------------
db_recovery_file_dest string
db_recovery_file_dest_size big integer 20G
recovery_parallelism integer 0
SQL> alter system set db_recovery_file_dest='/home/oracle/flashback' scope=both;
alter system set db_recovery_file_dest='/home/oracle/flashback' scope=both
*
ERROR at line 1:
ORA-02097: parameter cannot be modified because specified value is invalid
ORA-16019: cannot use db_recovery_file_dest with LOG_ARCHIVE_DEST or LOG_ARCHIVE_DUPLEX_DEST
查看 LOG_ARCHIVE_DES 发现
SQL>show parameter LOG_ARCHIVE_DES
log_archive_dest string /u01/app/oracle/arch
已经设置了归档路径,需要清空
SQL>alter system set log_archive_dest='' scope=both;
之后再执行
alter system set db_recovery_file_dest='/home/oracle/flashback' scope=both;
成功。
在打开数据库的flashback必须要mount状态下方可以,于是:
SQL> shutdown immediate;
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> startup mount;
ORACLE instance started.
Database mounted.
SQL> alter database flashback on;
Database altered.
SQL> alter database open;
Database altered.
SQL> select name,log_mode,flashback_on from v$database;
NAME LOG_MODE FLASHBACK_ON
--------- ------------------ ------------
ORA11G ARCHIVELOG YES
阅读(1651) | 评论(0) | 转发(0) |