数据库版本
SQL> select * from v$version;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.1.0.7.0 - 64bit Production
PL/SQL Release 11.1.0.7.0 - Production
CORE 11.1.0.7.0 Production
TNS for Linux: Version 11.1.0.7.0 - Production
NLSRTL Version 11.1.0.7.0 - Production
数据库开启了闪回模式和归档
SQL> select name,flashback_on,log_mode from v$database;
NAME FLASHBACK_ON LOG_MODE
--------- ------------------ ------------
RMANDB YES ARCHIVELOG
查询出的最早闪回点为 26031573
SQL> select * from v$flashback_database_log;
OLDEST_FLASHBACK_SCN OLDEST_FLASHBACK_T RETENTION_TARGET FLASHBACK_SIZE
-------------------- ------------------ ---------------- --------------
ESTIMATED_FLASHBACK_SIZE
------------------------
26031573 25-DEC-14 1440 15941632
30695424
闪回保存周期为一天
SQL> show parameter db_flashback_retention_target
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_flashback_retention_target integer 1440
FRA占用率8%左右
SQL> select * from v$flash_recovery_area_usage;
FILE_TYPE PERCENT_SPACE_USED PERCENT_SPACE_RECLAIMABLE
-------------------- ------------------ -------------------------
NUMBER_OF_FILES
---------------
CONTROL FILE 0 0
0
REDO LOG 0 0
0
ARCHIVED LOG 5.85 0
3
BACKUP PIECE 2.34 1.87
5
IMAGE COPY 0 0
0
FLASHBACK LOG .74 0
1
FOREIGN ARCHIVED LOG 0 0
0
7 rows selected.
但是在执行数据库闪回时,仍然提示错误
SQL> flashback database to scn 26031573;
flashback database to scn 26031573
*
ERROR at line 1:
ORA-38729: Not enough flashback database log data to do FLASHBACK.
请高手指点
------解决思路----------------------
Flashback Database的前提条件:
(1)数据库必须处于ARCHIVELOG模式
(2)数据库必须具有flash recovery area,为此需要设置如下参数:
? DB_RECOVER_FILE_DEST:确定Flashback日志的存放地点
? DB_RECOVER_FILE_DEST_SIZE:确定Flashback日志恢复区的大小
? DB_FLASHBACK_RETENTION_TARGET:设定闪回数据的保存时间,单位是分钟。默认是1440分钟(一天)
(3)对于RAC数据库,flash recovery area必须存储在集群文件系统或ASM内
------解决思路----------------------
1、闪回操作前,推荐查看一下v$flashback_database_log视图,检查最远可以回到哪里:
select oldest_flashback_scn,to_char(oldest_flashback_time,'YYYY-MM-DD HH24:MI:SS') from v$flashback_database_log;
2、闪回操作需在MOUNT状态下进行