Oracle Restore Points
Oracle Restore Points let you mark a point in time to which you can later flashback (rollback) your database quickly. Think of them as “checkpoints” — useful before critical changes or patches to avoid costly restores.
Types of Restore Points
Type | Description | Use Case |
---|---|---|
Normal Restore Point | Marks a restore point without guaranteeing flashback logs retention | For short-term flashback within retention period |
Guaranteed Restore Point | Ensures flashback logs are retained regardless of retention settings | Before high-risk changes, patches, upgrades |
1. Check Existing Restore Points
SET PAGESIZE 50
SET LINESIZE 120
COL NAME FORMAT A30
COL SCN FORMAT 999999999999
COL TIME FORMAT A30
COL GUARANTEE_FLASHBACK_DATABASE FORMAT A10
SELECT NAME, SCN, TIME, GUARANTEE_FLASHBACK_DATABASE FROM V$RESTORE_POINT;
- Lists all restore points with their SCN, timestamp, and guarantee status.
2. Create Restore Points
Normal Restore Point
CREATE RESTORE POINT restore_point_name;
Guaranteed Restore Point
CREATE RESTORE POINT restore_point_name GUARANTEE FLASHBACK DATABASE;
- Use guaranteed for critical updates or changes to ensure rollback capability even if flashback logging is disabled or retention expires.
3. Drop Restore Point
DROP RESTORE POINT restore_point_name;
- Important to drop guaranteed restore points once no longer needed to free flashback log space.
4. Flashback Database to Restore Point
FLASHBACK DATABASE TO RESTORE POINT restore_point_name;
- Use this to rollback your database quickly to the restore point state after a failure or mistake.
Important Notes & Best Practices
- Always create a guaranteed restore point before applying patches, schema changes, or upgrades.
- Monitor flashback log space since guaranteed restore points retain logs and consume storage.
- Drop restore points when done to avoid unnecessary space usage.
- Flashback requires FLASHBACK DATABASE to be enabled and proper flashback retention set.
- You can only flashback if your database is in ARCHIVELOG mode.
- Restore points do not replace traditional backups but speed up recovery for recent changes.
Real-World Usage Examples
Scenario | Recommended Restore Point Type | Notes |
---|---|---|
Before Patch/Upgrade | Guaranteed Restore Point | Ensures you can rollback even if flashback logs would normally be purged |
Development & Testing | Normal Restore Point | Lightweight checkpoint for quick rollback during dev cycles |
Disaster Recovery | Guaranteed Restore Point (created beforehand) | Minimizes downtime on failure |
Summary
Oracle Restore Points offer a fast, lightweight way to create recovery checkpoints in your database. Use guaranteed restore points before critical changes to ensure safe rollback. Always monitor your flashback space and clean up restore points when finished. This approach saves time and reduces risk during database maintenance and upgrades.