OracleBackup & recovery
Flashback status and restore points
Whether flashback is on, how far back you can go, and every restore point. A forgotten guaranteed restore point will keep filling the FRA until it's dropped.
Not yet verified. How scripts are tested
1CLEAR COLUMNS2SET LINESIZE 140 PAGESIZE 100 TRIMOUT ON TAB OFF3COLUMN flashback_on HEADING "FLASHBACK" FORMAT A184COLUMN log_mode HEADING "LOG MODE" FORMAT A125COLUMN oldest_flashback HEADING "OLDEST POSSIBLE" FORMAT A166COLUMN retention_target HEADING "TARGET MIN" FORMAT 999,9907COLUMN flashback_mb HEADING "FLASHBACK LOGS MB" FORMAT 99,999,9908COLUMN name HEADING "RESTORE POINT" FORMAT A309COLUMN scn FORMAT 9999999999999999910COLUMN created FORMAT A1611COLUMN guaranteed HEADING "GUARANTEED" FORMAT A1012COLUMN storage_mb HEADING "STORAGE MB" FORMAT 99,999,99013 14SELECT flashback_on, log_mode FROM v$database;15 16SELECT TO_CHAR(oldest_flashback_time, 'YYYY-MM-DD HH24:MI') AS oldest_flashback,17 retention_target,18 ROUND(flashback_size / 1048576) AS flashback_mb19FROM v$flashback_database_log;20 21SELECT name, scn,22 TO_CHAR(time, 'YYYY-MM-DD HH24:MI') AS created,23 guarantee_flashback_database AS guaranteed,24 ROUND(storage_size / 1048576) AS storage_mb25FROM v$restore_point26ORDER BY time;Save it as ora-flashback.sql and run it with SQL> @ora-flashback.
Open in denrepoRelated tool: RMAN command builder
Helps with
More Oracle scripts: Backup & recovery
- RMAN backup history with run time in hoursRun in the target database as SYSDBA, not the recovery catalog. The first report lists every RMAN job (full, incremental and archivelog) with start,…
- RMAN backup jobs in the last 7 daysStatus, duration and output size of each RMAN job, newest first.
- Running RMAN job progressPercent complete and time remaining for each RMAN channel that's working right now.
- Datafiles without a recent backupDatafiles with no backup of any kind in the last two days, or none at all. A new datafile added after the last full backup shows up here first.
- RMAN configuration (non-default settings)The persistent CONFIGURE settings stored in the control file, the same list SHOW ALL marks as changed. Check retention and control file autobackup…
- Fast Recovery Area usageFRA size, used and reclaimable space, then what's using it by file type. Real used % is the number that matters: at 100% the database stops archiving…