OracleBackup & recovery
Datafiles without a recent backup
Datafiles 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.
Not yet verified. How scripts are tested
1CLEAR COLUMNS2SET LINESIZE 140 PAGESIZE 100 TRIMOUT ON TAB OFF3COLUMN file# HEADING "FILE#" FORMAT 999994COLUMN name HEADING "DATAFILE" FORMAT A755COLUMN last_backup HEADING "LAST BACKUP" FORMAT A166 7SELECT f.file#, f.name,8 NVL(TO_CHAR(MAX(b.completion_time), 'YYYY-MM-DD HH24:MI'), 'never') AS last_backup9FROM v$datafile f10LEFT JOIN v$backup_datafile b ON b.file# = f.file#11GROUP BY f.file#, f.name12HAVING MAX(b.completion_time) IS NULL13 OR MAX(b.completion_time) < SYSDATE - 214ORDER BY f.file#;Save it as ora-backup-gaps.sql and run it with SQL> @ora-backup-gaps.
Open in denrepoRelated tool: RMAN command builder
Helps with
Part of these runbooks
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.
- 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…
- Flashback status and restore pointsWhether 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…