We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10
Using Flashback Database in Oracle Data
Guard
By: Ahmed Baraka
Objectives In this lecture, you will learn how to perform the following: • Flashback the primary database to specific point-in-time in Oracle 12c and 19c • Use standby database flashback to restore lost data
About Flashback Technologies in Oracle Database Name Target Flashback Database Restores the database to a past point-in-time Flashback Table Recovers tables to a specific point-in-time Flashback Drop Recovers an accidentally dropped table Flashback Transaction Undo the effects of a single transaction Flashback Transaction Query Sees the changes made by a transaction Flashback Query Query any data at a point-in-time in the past Flashback Versions Query Retrieves versions of a row in a time interval Total Recall Query long-term historical data
About Flashback Technologies in Oracle Database Name Target Flashback Database Restores the database to a past point-in-time Flashback Table Recovers tables to a specific point-in-time Flashback Drop Recovers an accidentally dropped table Flashback Transaction Undo the effects of a single transaction Flashback Transaction Query Sees the changes made by a transaction Flashback Query Query any data at a point-in-time in the past Flashback Versions Query Retrieves versions of a row in a time interval Total Recall Query long-term historical data
About Flashback Database • Allows to quickly rewind the database to specific point-in-time • Its retention period is defined by DB_FLASHBACK_RETENTION_TARGET • Flashback logs are saved in DB_RECOVERY_FILE_DEST • Can be enabled by running the statement: ALTER DATABASE FLASHBACK ON;
Flashback Database Procedure 1. Shutdown the database 2. Startup the database in mount mode 3. Flashback the database to the required restore point: FLASHBACK DATABASE TO SCN <scn>; FLASHBACK DATABASE TO TIMESTAMP <timestamp>; FLASHBACK DATABASE TO RESTORE POINT <restore_point>;
4. Open the database in read only mode to verify the data is
recovered 5. Shutdown the database and open it using RESETLOGS option
Flashback Database in Data Guard • If it is needed to flashback the primary database: – Oracle 12c: the standby database should be flashed back as well – Oracle 19c: MRP automatically flashes back the Standby (should be mounted) when the primary database is opened using RESETLOGS • Lost data can be recovered by flashing back the standby database • After failover: failed primary database can be reinstated by flashing it back (instead of rebuilding it)
Performing Flashback Database on the Primary in Oracle 12c 1. Perform the flashback at the primary database 2. Perform the flashback at the standby database: a) Make sure the MRP process is shut down b) Make sure the standby database is running in MOUNT state c) Flashback the database to a restore point before the recovery restore point d) Start the redo apply services
Using Flashback Database on Standby Databases to Recover Lost Data 1. Mount the Standby database (if it is not already mounted) 2. Stop the Redo Apply services 3. Flashback the Standby database to the required recovery point 4. Re-start the Standby database in read only mode 5. Migrate the recovered data to the primary database 6. Mount the Standby database 7. Start the Redo Apply services
Summary In this lecture, you should have learnt how to perform the following: • Flashback the primary database to specific point-in-time in Oracle 12c and 19c • Use standby database flashback to restore lost data