Enabling Flashback Database in Oracle:
SQL> select flashback_on from v$database;
FLASHBACK_ON
------------------
NO
SQL> SHUTDOWN IMMEDIATE;
SQL> STARTUP MOUNT;
SQL> ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=4320; # 3 days
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST_SIZE=10737418240; # 10G
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='/u01/app/oracle/flash_recovery_area';
SQL> show parameter DB_RECOVERY_FILE_DEST
NAME TYPE VALUE
------------------------------------ ----------- ------------------------------
db_recovery_file_dest string /u01/app/oracle/flash_recovery_area
db_recovery_file_dest_size big integer 10G
SQL> ALTER DATABASE FLASHBACK ON;
SQL> ALTER DATABASE OPEN;
SQL> SELECT flashback_on FROM v$database;
FLASHBACK_ON
-----------------
YES
In order to disable flash recovery area issue,
SQL> ALTER SYSTEM SET DB_RECOVERY_FILE_DEST='' SCOPE=BOTH SID='*';
System altered
To check the estimated flashback size :
SQL> SELECT ROUND(ESTIMATED_FLASHBACK_SIZE/1024/1024/1024) FROM V$FLASHBACK_DATABASE_LOG;
To create a guaranteed restore point :
SQL> create restore point RESTORE_POINT guarantee flashback database;
SQL> select NAME, SCN, TIME from V$RESTORE_POINT;
To flashback the database to specific time :
SQL> flashback database to timestamp to_timestamp('dd/mm/ccyy HH24:MI:SS', 'DD/MM/YYYY HH24:MI:SS');
To drop a restore point
SQL> select NAME, SCN, TIME from V$RESTORE_POINT;
SQL> drop restore point RESTORE_POINT;
No comments:
Post a Comment