Flashback Database

Flashback a database to a particular SCN

Set up database for flashback:
–SHUTDOWN IMMEDIATE;
–STARTUP MOUNT;
–Do not need to restart database
–Can do it with database open
ALTER SYSTEM SET DB_FLASHBACK_RETENTION_TARGET=2880 SCOPE=BOTH;
/* 1 day = 1440 */
/* 2 days = 2880 */
/* 3 days = 4320 */
ALTER DATABASE FLASHBACK ON;
–ALTER DATABASE OPEN;
SELECT FLASHBACK_ON FROM V$DATABASE;
>> ON
SELECT FLASHBACK_SIZE FROM V$FLASHBACK_DATABASE_LOG;
SELECT NAME, BYTES FROM V$FLASHBACK_DATABASE_LOGFILE;
Flashback database to specific SCN:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
FLASHBACK DATABASE TO SCN 53943;
Review the changes in READ ONLY mode:
ALTER DATABASE OPEN READ ONLY;
ALTER PLUGGABLE DATABASE ALL OPEN READ ONLY;
Finalize the flashback
ALTER DATABASE OPEN RESETLOGS;
If there are any pluggable databases, open them:
ALTER PLUGGABLE DATABASE ALL OPEN;

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