Wednesday, March 28, 2012

Flashback Database 11g

To enable flashback database login as sysdba and execute the following:

SQL> alter system set db_recovery_file_dest_size=12G scope=both;

SQL> alter system set db_recovery_file_dest='/oraarch/oracle/flash_recovery_area' scope=both;

SQL> alter system set db_flashback_retention_target = 2880 scope=both;

SQL>  shutdown immediate;

SQL> startup mount;

SQL> alter database flashback on;

SQL> alter database open;

 
To restore to a previous state:

SQL> shutdown immediate;

 SQL> startup mount exclusive;

-- be sure to substitute your SCN

SQL> FLASHBACK DATABASE TO SCN 19513917;

or

SQL> FLASHBACK DATABASE TO RESTORE POINT bef_damage;

 or

 SQL> FLASHBACK DATABASE TO TIMESTAMP (SYSDATE-1/24);

or

 SQL> FLASHBACK DATABASE TO TIMESTAMP timestamp'2012-03-27 14:00:00';

or

 SQL> FLASHBACK DATABASE
TO TIMESTAMP to_timestamp('2012-03-27 16:00:00', 'YYYY-MM-DD HH24:MI:SS');

SQL> alter database open resetlogs;

 

Flashback Related Database Views

GV_$FLASHBACK_DATABASE_LOG

V_$FLASHBACK_DATABASE_LOG

GV_$FLASHBACK_DATABASE_LOGFILE

V_$FLASHBACK_DATABASE_LOGFILE

GV_$FLASHBACK_DATABASE_STAT

5 comments:

  1. Hello, its pleasant paragraph on the topic of media print, we
    all be aware of media is a fantastic source of data.

    Here is my page - voyance par telephone

    ReplyDelete
  2. Admiring the persistence you put into your website and
    detailed information you offer. It's nice to come across a blog every once in a while that isn't the same
    outdated rehashed information. Wonderful read! I've saved your site and I'm adding your RSS feeds to
    my Google account.

    My site ... voyance par mail :: ::

    ReplyDelete
  3. Quality articles is the secret to be a focus for the viewers to pay a visit the website, that's what this web page is providing.

    My web page; voyance par telephone *www.irisvoyance.com*

    ReplyDelete