Backup and Recovery
Backup and Recovery tests the RMAN decision chain: what to back up, how retention interacts, and why restore differs from recover.
Core concepts
ARCHIVELOG mode plus a fast recovery area is the baseline for point-in-time recovery. RMAN writes backup sets (compressed, multiplexed) or image copies. Incremental level 0 is the base; level 1 is differential by default or cumulative since the last level 0. Block change tracking speeds incremental backups. Include the control file and SPFILE via autobackup. CONFIGURE RETENTION POLICY TO REDUNDANCY n or TO RECOVERY WINDOW OF n DAYS defines obsolete; CROSSCHECK marks missing files EXPIRED, and DELETE OBSOLETE or DELETE EXPIRED removes them. A recovery catalog is optional; NOCATALOG keeps metadata in the control file.
Restore versus recover
RESTORE copies files back from backup. RECOVER applies redo, archived and online, to roll forward, after which the instance rolls back uncommitted changes. Incomplete recovery (UNTIL TIME, UNTIL SCN, UNTIL CANCEL) requires opening with RESETLOGS.
Worked example
A table is dropped at 10:05 and noticed at 10:30. With ARCHIVELOG enabled, first try FLASHBACK TABLE ... TO BEFORE DROP from the recycle bin. Otherwise perform point-in-time recovery to 10:04: shut down, STARTUP MOUNT, RESTORE DATABASE, RECOVER DATABASE UNTIL TIME, ALTER DATABASE OPEN RESETLOGS, then take a fresh backup because pre-resetlogs backups complicate later recovery.
Traps
Believing RESTORE applies redo; forgetting archived logs are required to recover; deleting archived logs outside RMAN and breaking recoverability; assuming RMAN backs up the password file; running incomplete recovery without RESETLOGS; treating obsolete and expired as synonyms.