Wednesday, November 2, 2016
SQL> select name,flashback_on from v$database;
NAME FLASHBACK_ON
--------- ------------------
hello YES
SQL> select name,time,guarantee_flashback_database from v$restore_point;
-- List Flashback Log Details.
--
SET PAUSE ON
SET PAUSE 'Press Return to Continue'
SET PAGESIZE 60
SET LINESIZE 300
SET VERIFY OFF
COLUMN "Log NO" FOR 9,999
COLUMN "Thread No" FOR 99
COLUMN "Seq No" FOR 99
COLUMN name FOR A50
COLUMN "Size(GB)" FOR 999,999
COLUMN "First Chg No" FOR 999,999,999,999,999,999
ALTER SESSION
SET nls_date_format='DD MON YYYY hh24:mi:ss'
/
SELECT
log# as "Log No",
thread# as "Thread No",
sequence# as "Seq No",
name,
bytes/1024/1024/1024 as "Size(GB)",
first_change# as "First Chg No",
first_time
FROM
v$flashback_database_logfile
/
FLASHBACK DATABASE to a Restore Point
Ref:
http://docs.oracle.com/cd/B28359_01/backup.111/b28273/rcmsynta023.htm
SQL> CREATE RESTORE POINT before_update GUARANTEE FLASHBACK DATABASE;
The bulk update fails, leaving the database with extensive corrupted data. You start an RMAN session, connect to the target database and recovery catalog, and list the guaranteed restore points:
RMAN> LIST RESTORE POINT ALL;
SCN RSP Time Type Time Name
---------------- --------- ---------- --------- ----
412742 GUARANTEED 15-FEB-07 BEFORE_UPDATE
You mount the database, flash back the database to the restore point (sample output included), and then open the database with the RESETLOGS option:
RMAN> SHUTDOWN IMMEDIATE
RMAN> STARTUP MOUNT
RMAN> FLASHBACK DATABASE TO RESTORE POINT 'BEFORE_UPDATE';
Starting flashback at 15-FEB-07
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=104 device type=DISK
starting media recovery
archived log for thread 1 with sequence 34 is already on disk as file /disk2/oracle/oradata/prod/arch/archive1_34_614598462.dbf
media recovery complete, elapsed time: 00:00:01
Finished flashback at 15-FEB-07
RMAN> ALTER DATABASE OPEN RESETLOGS;
Note.305648.1 What is a Flash Recovery Area and how to configure it ?
Note.369759.1 FLASH RECOVERY AREA and FLASHBACK database
Note.833663.1 Flash Recovery Area - FAQ
Note.560133.1 Benefits Of Using Flash Recovery Area
Note.315098.1 How is the space pressure managed in the Flash Recovery Area - An Example.
Note.305812.1 Flash Recovery area - Space management Warning & Alerts
Note.829755.1 Space issue in Flash Recovery Area( FRA )
Note.305810.1 Configuring file creation in Flash recovery area and order of Precedence
Note.305651.1 How to change Flash Recovery Area to a new location ?
Note.762934.1 Flash Recovery Area Sizing
The articles listed below help you in understanding the concepts,configuration,usage and known issues of the flashback database feature:
Note.249319.1 Configure flashback database
Note.565535.1 Flashback Database Best Practices & Performance
Note.834824.1 Recovering Dropped User using Flashback Database
Note.330535.1 Restore Points in Oracle10g Release2
Note.369759.1 FLASH RECOVERY AREA and FLASHBACK database
Note.761126.1 CALCULATE THE VOLUME OF FLASHBACK LOG GENERATION
Note.369755.1 Flashback Logs-Space management
Note.427222.1 FLASHBACK LOGS NOT PURGED WHEN ARCHIVER DOESN'T HAVE DISK SPACE
Note.454768.1 Can you use flashback database if a period of noarchivelog exists
Note.566647.1 Guaranteed Restore Point with Flashback Database disabled generates too many flashback logs
Note.833584.1 How To Disable Flashback Database Without A Bounce
Note.828410.1 High "Flashback buf free by RVWR" waits
Note.386262.1 Cloning database using EM Fails If flashback is ON
Note.342764.1 Flashback 'ON' fails with ORA-38706 and ORA-38714
Note.829254.1 Database Crashed With ORA-19815 ORA-19809 ORA-16038
Note.847090.1 Flashback Database Failed With ORA-19554 and ORA-27001
Note.554445.1 ORA-26040 FLASHBACK DATABASE WITH NOLOGGING OBJECTS/ACTIVITIES RESULTS IN CORRUPTION
Note.444389.1 Querying V$Flashback_Database_Log Or Flashing Back Database to Before Resetlogs Triggers ORA-07445 [krfbDoConvertPlugin]
Note.982104.1 Workaround for Flashback Database fails with ORA-38753 ORA-01110