Saturday, January 12, 2013

ORACLE - Flashback database

Flashback database is a new feature as of Oracle 10g that can be used to quickly flashback a database to a point in time.

Advantage of Flashback features:
1)Point-in-time recovery – to quickly rewind the database to point-in-time by using restore points.
2)Data Guard Fast-start fail-over - to quickly reinstate the primary database
3)Manual primary database reinstate
4)11g Data Guard Snapshot Standby
5)Restoring Test and Training Databases
6)RMAN -One 11g example of RMAN implicit use of flashback database is when block media recovery is performed.

How to configure flashback database ?
DB_FLASHBACK_RETENTION_TARGET : Determines how far back in time you can recover the flashback database (default 1440 )

How to delete flashback logs ?
1) Verify the flashback logs:
SELECT file_type, trunc(space_used*percent_space_used/100/1024/1024/1024) used,
trunc(space_reclaimable*percent_space_reclaimable/100/1024/1024/1024) reclaimable,
B.number_of_files FROM v$recovery_file_dest A, v$flash_recovery_area_usage B;

FILE_TYPE          USED RECLAIMABLE NUMBER_OF_FILES
------------ ---------- ----------- ---------------
CONTROLFILE            0               0                 0
ONLINELOG                1               0                47
ARCHIVELOG           39               0            2881   => Check Archive log
BACKUPPIECE            0               0                43   => Check RMAN backup
IMAGECOPY                0               0                 0
FLASHBACKLOG         122          0            12582   => Check Flashback log

2) Strop the instance or database:
srvctl stop instance -d DBNAME -i InstanceName1
srvctl stop instance -d DBNAME -i InstanceName2

3) Drop the flashback logs:
alter database flashback off;

4) Enable flashback logs:
alter database flashback on;

5) Start the instance or database:
srvctl start instance -d DBNAME -i InstanceName1
srvctl stop instance  -d DBNAME -i InstanceName2


No comments:

Post a Comment