Flashback Database – Enable/Disable

Hi, this is the quick one, sometimes we forget the basic stuffs, so …
https://docs.oracle.com/cd/E11882_01/backup.112/e10642/flashdb.htm#BRADV582

--- Enable Flashback Database:

select FLASHBACK_ON from v$database;

1.) Choose the DIRECTORY:
/u01/oradata/KDBPP/FRA

2.) SHUT Immediate;

3.) Startup mount;

4.) Enable Archivelog Mode, if needed

alter database archivelog;

5.) Define the FRA - Size:
alter system set db_recovery_file_dest_size=50g scope=both;

6.) Define the FRA - Directory:
alter system set db_recovery_file_dest='/u01/oradata/KDBPP/FRA' scope=both;

7.) Enable FLASHBACK on DATABASE:
alter database flashback on;

8.) Open database:
alter database open;

-- Disable:
1.) Shutdown Database;
shut immediate;

2.) Startup mount;

3.) alter database flashback off;

4.) If needed, disable the Archivelog
alter database noarchivelog;

5.) alter database open;

select FLASHBACK_ON from v$database;

--------------------------------------------------------------------
Note:

If you face this issue (ORA-38781: cannot disable media recovery - 
have guaranteed restore points) trying put back in NOARCHIVELOG mode.

You need drop the active restore point before, so :

a.) SELECT NAME, SCN, TIME, DATABASE_INCARNATION#,
        GUARANTEE_FLASHBACK_DATABASE,STORAGE_SIZE
        FROM V$RESTORE_POINT; 

b.) drop restore point <RESTORE POINT NAME>;

c.) if you are in MOUNT state you can execute:
alter database noarchivelog;


Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s