
Oracle SQL Certification 1Z0-071 Course | Section 16: Flashback Operations
This section walks you through everything from restoring dropped tables to querying historical data without modifying anything.

Flashback operations are one of Oracle’s most powerful features for data recovery and historical analysis. Instead of relying only on backups, Oracle allows you to go back in time, recover lost data, and analyze how data has changed.
Lesson 1: What Are Flashback Operations
Flashback operations allow you to recover and analyze past states of your database.
Instead of restoring from backups, you can:
- Recover dropped tables
- Restore previous versions of data
- Analyze historical changes
- Query past states without modifying current data
Why Flashback Is Important
Flashback features are essential for:
- Recovering accidental deletes or updates
- Troubleshooting data issues
- Auditing changes over time
- Reducing downtime compared to backups
Oracle achieves this using internal mechanisms like undo data and system tracking.
Lesson 2: Recover Dropped Tables
When you drop a table in Oracle, it is not immediately deleted. Instead, it is moved to the Recycle Bin.
How the Recycle Bin Works
Dropped tables:
- Are stored in the Recycle Bin
- Retain their data and structure
- Can be restored easily
You can view dropped objects using:
SELECT * FROM USER_RECYCLEBIN;
Restoring a Table
To recover a dropped table:
FLASHBACK TABLE employees TO BEFORE DROP;
This restores:
- Table data
- Indexes
- Constraints
Permanent Deletion
To permanently remove a table:
PURGE TABLE employees;
To clear everything:
PURGE RECYCLEBIN;
Renaming During Recovery
You can also restore a table with a new name:
FLASHBACK TABLE employees TO BEFORE DROP RENAME TO employees_old;
Lesson 3: Recover Data Using Timestamp
Flashback allows you to restore a table to a specific point in time.
Example Using Timestamp
FLASHBACK TABLE employees
TO TIMESTAMP (SYSTIMESTAMP - INTERVAL '10' MINUTE);
This restores the table to how it looked 10 minutes ago.
Key Requirements
Before using Flashback Table:
ALTER TABLE employees ENABLE ROW MOVEMENT;
This is required because rows may need to move during recovery.
Why This Is Useful
- Recover accidental updates
- Restore deleted rows
- Avoid full database restore
Lesson 4: Recover Data Using SCN
The System Change Number (SCN) represents a precise point in the database’s transaction history.
Each transaction increases the SCN, making it a very accurate recovery reference.
Getting Current SCN
SELECT DBMS_FLASHBACK.GET_SYSTEM_CHANGE_NUMBER FROM dual;
Flashback Using SCN
FLASHBACK TABLE employees
TO SCN 123456;
Additional Tools
ORA_ROWSCN→ shows SCN for each row- Convert SCN ↔ timestamp using built-in functions
Why Use SCN
SCN-based recovery is:
- More precise than timestamps
- Ideal for exact recovery points
- Useful in high-transaction environments
Lesson 5: Recover Data Using Restore Point
A restore point is a user-defined marker for a specific moment in time.
Creating a Restore Point
CREATE RESTORE POINT before_update;
Flashback to Restore Point
FLASHBACK TABLE employees
TO RESTORE POINT before_update;
Removing a Restore Point
DROP RESTORE POINT before_update;
Why Use Restore Points
- Easy to define recovery checkpoints
- Similar to savepoints in transactions
- Useful before major data changes
Lesson 6: Flashback Query
Flashback Query allows you to view past data without restoring anything.
Example Using Timestamp
SELECT *
FROM employees
AS OF TIMESTAMP (SYSTIMESTAMP - INTERVAL '1' HOUR);
Example Using SCN
SELECT *
FROM employees
AS OF SCN 123456;
Key Benefits
- No changes to current data
- Safe for auditing and analysis
- Compare past vs current data
Final Thoughts
Flashback operations are one of Oracle’s most powerful features for data recovery and historical analysis.
They allow you to:
- Recover dropped tables instantly
- Restore data to a previous state
- Analyze changes over time
- Query historical data without modifying anything
For the Oracle 1Z0-071 exam, understanding Flashback is crucial — but even more importantly, it’s a real-world skill that can save hours (or days) of recovery work.
Make sure to practice each method (Recycle Bin, Timestamp, SCN, Restore Point, and Flashback Query) to fully understand how and when to use them.
