在10g,11g中,flashback默认是关闭的。这个功能在处理表误删除或者数据误删除的恢复中还是有很重要的作用的。建议将其开启。
开启过程如下:
1)检查数据库flashback是否开启
SYS@PROD>select open_mode,log_mode,flashback_on from v$database;
OPEN_MODE LOG_MODE FLASHBACK_ON
---------- ------------ ------------------
READ WRITE ARCHIVELOG NO
从flashback_on列显示为NO,说明flashback没有启用。
2)配置flashback相关的参数
SYS@PROD>show parameter recovery
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string
db_recovery_file_dest_size big integer 0
recovery_parallelism integer 0
SYS@PROD>
SYS@PROD>
SYS@PROD>alter system set db_recovery_file_dest='/u01/app/oracle/flashback' scope=spfile;
System altered.
SYS@PROD>alter system set db_recovery_file_dest_size=2G scope=spfile;
System altered.
3)重启数据库,将数据库启动到mount状态
SYS@PROD>shutdown immediate
Database closed.
Database dismounted.
ORACLE instance shut down.
SYS@PROD>startup mount
ORACLE instance started.
Total System Global Area 524288000 bytes
Fixed Size 1220384 bytes
Variable Size 163578080 bytes
Database Buffers 356515840 bytes
Redo Buffers 2973696 bytes
Database mounted.
SYS@PROD>
4)打开flashback
SYS@PROD>alter database flashback on;
Database altered.
5)启动数据库
SYS@PROD>alter database open;
Database altered.
SYS@PROD>select open_mode,log_mode,flashback_on from v$database;
OPEN_MODE LOG_MODE FLASHBACK_ON
---------- ------------ ------------------
READ WRITE ARCHIVELOG YES
这时检查flashback_on列显示为YES说明flashback配置成功。
--END--