In order to use the guaranteed restore point feature Flash Recovery Area must be configured. To enable Flash Recovery Area we need setup the fwo parameters: DB_RECOVERY_FILE_DEST_SIZE and DB_RECOVERY_FILE_DEST. DB_RECOVERY_FILE_DEST_SIZE should be set before DB_RECOVERY_FILE_DEST.
For example: SQL> alter system set DB_RECOVERY_FILE_DEST_SIZE=10G / SQL> alter system set DB_RECOVERY_FILE_DEST='/opt/oracle10/flash_recovery_area/rdb4' /
SQL> Alter database flashback on /
And of course the database must be in ARCHIVELOG mode.
To check if Flash recovery area was enabled: SQL> select flashback_on from v$database ;
FLASHBACK_ON ------------------ RESTORE POINT ONLY
SQL> select name, flashback_on from v$tablespace ;
NAME FLA ------------------------------ --- TBS_INDEX YES TBS_INDEX_BIG NO
If we see that flashback was not enabled for some of the tablespaces then enable manually for each of the tablespaces:
SQL> shutdown immediate; SQL> startup mount; SQL> alter tablespace TBS_INDEX_BIG flashback on;
Creating a guaranteed restore point (have to login as SYSDBA): sqlplus "/ as sysdba" SQL> create restore point before_version guarantee flashback database;
Restoring database upto the restore point: sqlplus "/ as sysdba" SQL> shutdown immediate; SQL> startup mount; SQL> FLASHBACK database TO RESTORE POINT before_version; SQL> alter database open resetlogs;
List existing restore points:
SELECT NAME, SCN, TIME, DATABASE_INCARNATION#,
GUARANTEE_FLASHBACK_DATABASE, STORAGE_SIZE
FROM V$RESTORE_POINT
WHERE GUARANTEE_FLASHBACK_DATABASE='YES';
Look at: http://www.orafaq.com/node/2379
If we need to disable Flash Area: 1. delete all restore points created earlier; 2. alter system set DB_RECOVERY_FILE_DEST='' scope=spfile; 3. shutdown immediate; 4. startup mount; 5. alter database flashback off; 6. alter database open;
|