What is point-in-time recovery?

What is point-in-time recovery?

In the traditional world of database recovery, if a user accidentally drops a critical table or a batch job goes haywire, the solution is a nightmare: you have to restore the entire database from a backup and then "roll forward" using archive logs. This can take hours or even days.

Oracle Flashback Database is the "Undo" button for your entire database. It allows you to rewind the database to a specific point in time in a matter of minutes, regardless of how large the database is.


1. How It Works: The "Reverse" Logs

Instead of rebuilding the database from a backup, Flashback uses Flashback Logs.

  • The Mechanism: When Flashback is enabled, a background process called RVWR (Recovery Writer) periodically copies "before images" of modified blocks from the memory to the Flashback Logs in the Fast Recovery Area (FRA).

  • The Rewind: When you issue a Flashback command, Oracle uses these "before images" to overwrite the current data blocks, essentially moving the database backward in time.

  • The Finish: Once the blocks are back to an older state, Oracle uses the standard Redo Logs to bring the database forward to the exact second you requested.


2. Why is it a Game-Changer?

Flashback Database is significantly faster than traditional recovery because it only touches the blocks that changed.

ScenarioTraditional RecoveryFlashback Database
User ErrorRestore 10TB + Apply Logs (12 hours).Rewind blocks (10 minutes).
Failed App UpgradeReinstall + Restore (6 hours).Flashback to "Restore Point" (5 minutes).
Data Guard FailoverRebuild old primary (Long).Reinstatement (Automatic/Fast).

3. Guaranteed Restore Points (GRP)

This is the "Safety Net" for DBAs. Before a risky operation (like an upgrade or a massive data migration), you can create a Guaranteed Restore Point.

Unlike normal Flashback, which might overwrite old logs if it runs out of space, a Guaranteed restore point forces Oracle to keep all logs necessary to get back to that specific moment. Even if the FRA fills up, Oracle will preserve the ability to go back.

SQL
-- Create a safety net
CREATE RESTORE POINT before_the_mess GUARANTEE FLASHBACK DATABASE;

4. The Flashback "Family"

"Flashback Database" is the big brother, but Oracle has a whole family of tools for different levels of "oops":

  • Flashback Query: See what a row looked like 10 minutes ago (using Undo data).

  • Flashback Table: Return a single table to a previous state without affecting the rest of the DB.

  • Flashback Drop: Bring a table back from the "Recycle Bin."


5. How to Enable It

You can enable Flashback while the database is open (in 11g and later), provided you are in ARCHIVELOG mode:

SQL
-- 1. Set the retention target (in minutes, e.g., 24 hours)
ALTER SYSTEM SET db_flashback_retention_target = 1440;

-- 2. Turn it on
ALTER DATABASE FLASHBACK ON;

6. Summary: The Pros and Cons

  • Pros: Incredible recovery speed, minimal human effort, and essential for modern Data Guard "reinstatement."

  • Cons: Requires extra disk space in the Fast Recovery Area (FRA) and adds a very slight overhead to write operations.


Peer Tip: Think of Flashback as your tactical recovery tool and RMAN backups as your strategic recovery tool. Flashback won't help you if a disk drive physically dies (for that, you need a backup!), but it is the perfect cure for human errors and logical corruption.

Looking for servers Rental ?

Call Our Expert :


  • (call for rental enquiries)

Email us :