0% found this document useful (0 votes)
11 views

Using Flashback Database in Oracle Data Guard

Dba notes

Uploaded by

Pavan Raghu
Copyright
© © All Rights Reserved
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
0% found this document useful (0 votes)
11 views

Using Flashback Database in Oracle Data Guard

Dba notes

Uploaded by

Pavan Raghu
Copyright
© © All Rights Reserved
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

Oracle© Data Guard Course – b y Ah m e d B a r a k a


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

Oracle© Data Guard Course – b y Ah m e d B a r a k a


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

Oracle© Data Guard Course – b y Ah m e d B a r a k a


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;

• To check if the flashback database


SELECT FLASHBACK_ON FROM V$DATABASE;

Oracle© Data Guard Course – b y Ah m e d B a r a k a


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

Oracle© Data Guard Course – b y Ah m e d B a r a k a


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)

Oracle© Data Guard Course – b y Ah m e d B a r a k a


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

Oracle© Data Guard Course – b y Ah m e d B a r a k a


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

Oracle© Data Guard Course – b y Ah m e d B a r a k a


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

Oracle© Data Guard Course – b y Ah m e d B a r a k a

You might also like