RMAN (Recovery Manager) is the Oracle Database tool for physical backup and recovery: it reads datafiles at block level, records every backup in the control file and works out on its own which files it needs to bring the database back to a specific point in time. It ships with every edition, starts with rman target /, and a basic backup is one line: BACKUP DATABASE PLUS ARCHIVELOG;.
In this guide I set up RMAN from scratch and put it to the test: ARCHIVELOG mode, incremental backups with block change tracking, cleanup of obsolete backups, validation, then the failures: a datafile deleted with rm, an accidental TRUNCATE, the loss of the control file and finally a full restore of the database on another server, all of them recovered. The output is real, trimmed where needed, captured in October 2026 on Oracle AI Database 26ai Free (release 23.26.3) in the gvenzl/oracle-free container. Where the Free edition behaves differently from Enterprise Edition, I point it out.
RMAN in 60 seconds
rman target / # connect to the CDB as SYSDBA (oracle user)
RMAN> SHOW ALL; # current configuration
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
RMAN> BACKUP INCREMENTAL LEVEL 0 TAG 'L0' DATABASE PLUS ARCHIVELOG; # weekly base
RMAN> BACKUP INCREMENTAL LEVEL 1 TAG 'L1' DATABASE PLUS ARCHIVELOG; # daily
RMAN> LIST BACKUP SUMMARY; # what is in the repository
RMAN> RESTORE DATABASE VALIDATE; # can the backups actually be read?
RMAN> CROSSCHECK BACKUP; # do the files still exist on disk?
RMAN> DELETE NOPROMPT OBSOLETE; # delete what the retention no longer needs
RMAN> RESTORE DATABASE; RECOVER DATABASE; # full restore (database in MOUNT)
Prerequisite: the database must be in ARCHIVELOG mode, otherwise backups with the database open are not possible and recovery stops at the last backup. It is the first step below.
What RMAN is and how it differs from Data Pump
Oracle offers two families of tools that are often confused. Data Pump (expdp/impdp) makes a logical backup: it exports tables, schemas and definitions to a dump file that can be imported again, even on another version or platform. RMAN makes a physical backup: it copies the datafile blocks, the archived redo logs, the control file and the SPFILE.
The difference shows when you restore. A Data Pump dump brings the data back to the moment of the export, and that is all. With RMAN you restore the datafiles and then apply the redo logs, so you can go back to any moment covered by the archived logs, up to the last commit before the failure. RMAN also checks blocks during the backup, restores a single datafile while the rest of the database stays open, and skips blocks that were never used. Data Pump is still useful for migrations and schema copies; for disaster recovery you need RMAN.
Prerequisite: ARCHIVELOG mode and Fast Recovery Area
The container starts out, like many fresh installations, in NOARCHIVELOG:
SQL> archive log list
Database log mode No Archive Mode
Automatic archival Disabled
Archive destination /opt/oracle/product/26ai/dbhomeFree/dbs/arch
Switching requires a restart, so a maintenance window:
SHUTDOWN IMMEDIATE;
STARTUP MOUNT;
ALTER DATABASE ARCHIVELOG;
ALTER DATABASE OPEN;
ALTER PLUGGABLE DATABASE ALL OPEN; -- PDBs do not reopen by themselves unless their state was saved
Watch the destination: without a Fast Recovery Area the archived logs end up in $ORACLE_HOME/dbs/arch, that is, on the software filesystem. The day it fills up, the database hangs waiting for archiving to resume. Set up a FRA right away on a dedicated filesystem, with an explicit quota:
ALTER SYSTEM SET db_recovery_file_dest_size=20G SCOPE=BOTH;
ALTER SYSTEM SET db_recovery_file_dest='/opt/oracle/oradata/fra' SCOPE=BOTH;
SQL> archive log list
Database log mode Archive Mode
Automatic archival Enabled
Archive destination USE_DB_RECOVERY_FILE_DEST
Set the quota before the destination, as in the example. From here on, archived logs, backup sets and control file autobackups go to the FRA, and RMAN manages it as space with a quota: as it approaches the limit, it deletes by itself the files that the retention declares no longer needed.
Configuring RMAN: SHOW ALL and the settings that matter
RMAN stores its persistent configuration in the control file. Before changing anything, look at the defaults:
RMAN> SHOW ALL;
CONFIGURE RETENTION POLICY TO REDUNDANCY 1; # default
CONFIGURE BACKUP OPTIMIZATION OFF; # default
CONFIGURE DEFAULT DEVICE TYPE TO DISK; # default
CONFIGURE CONTROLFILE AUTOBACKUP ON; # default
CONFIGURE DEVICE TYPE DISK PARALLELISM 1 BACKUP TYPE TO BACKUPSET; # default
CONFIGURE ENCRYPTION ALGORITHM 'AES256'; # default
CONFIGURE COMPRESSION ALGORITHM 'BASIC' AS OF RELEASE 'DEFAULT' OPTIMIZE FOR LOAD TRUE ; # default
CONFIGURE ARCHIVELOG DELETION POLICY TO NONE; # default
...
Two things many guides still present as necessary steps: control file and SPFILE autobackup is already on by default, and the default encryption algorithm is AES256. The settings I changed:
CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 7 DAYS;
CONFIGURE BACKUP OPTIMIZATION ON;
CONFIGURE DEVICE TYPE DISK PARALLELISM 2 BACKUP TYPE TO COMPRESSED BACKUPSET;
CONFIGURE COMPRESSION ALGORITHM 'MEDIUM';
CONFIGURE ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK;
RECOVERY WINDOW OF 7 DAYS: RMAN keeps all the backups and archived logs needed to bring the database back to any moment in the last 7 days. It makes more sense thanREDUNDANCY 1, which keeps a single full backup and guarantees no time window at all.BACKUP OPTIMIZATION ON: skips identical files that are already backed up, such as the read-only datafiles of PDB$SEED or archived logs already in a backup.COMPRESSED BACKUPSETwith theMEDIUMalgorithm: on my database the level 0 backup went from 3.12 GB read to 450 MB written. On Enterprise Edition the LOW, MEDIUM and HIGH algorithms require the Advanced Compression license; BASIC does not. Details in the licensing section.PARALLELISM 2: accepted by the configuration but ignored by the Free edition, as the backup output shows.
Full backup: BACKUP DATABASE PLUS ARCHIVELOG
Before running the first incremental I enabled block change tracking, covered shortly. The level 0 backup of the whole CDB, with the database open and in use:
RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG TAG 'L0_TEST';
Starting backup at 26-OCT-26
current log archived
RMAN-06908: warning: operation will not run in parallel on the allocated channels
RMAN-06909: warning: parallelism require Enterprise Edition
channel ORA_DISK_1: starting compressed archived log backup set
...
piece handle=/opt/oracle/oradata/fra/FREE/backupset/2026_10_26/o1_mf_annnn_L0_TEST_ofyvomd5_.bkp tag=L0_TEST
channel ORA_DISK_1: starting compressed incremental level 0 datafile backup set
input datafile file number=00001 name=/opt/oracle/oradata/FREE/system01.dbf
...
piece handle=/opt/oracle/oradata/fra/FREE/backupset/2026_10_26/o1_mf_nnnd0_TAG20261026T151606_ofyvopwo_.bkp tag=TAG20261026T151606
...
Starting Control File and SPFILE Autobackup at 26-OCT-26
piece handle=/opt/oracle/oradata/fra/FREE/autobackup/2026_10_26/o1_mf_s_1247670993_ofyvpkt3_.bkp
Finished Control File and SPFILE Autobackup at 26-OCT-26
real 0m34.814s
Three things to note in this output:
PLUS ARCHIVELOGforces a log switch, backs up the archived logs, backs up the datafiles and then also backs up the logs generated during the backup. The result is a backup that can be restored consistently.- The TAG did not end up on the datafiles: the datafile backup sets got the automatic tag
TAG20261026T151606. Written afterPLUS ARCHIVELOG, the TAG applies only to the archived logs. It belongs beforeDATABASE: withBACKUP INCREMENTAL LEVEL 1 TAG 'L1_TEST' DATABASE PLUS ARCHIVELOGevery piece of the next backup gotL1_TEST. - In a CDB the backup includes the root, PDB$SEED and every PDB: each container has its own subdirectory in the FRA, named after the PDB GUID.
Level 0 and level 1 incremental backups with block change tracking
A level 0 backup contains every used block and is the base for incrementals. A level 1 contains only the changed blocks: in differential mode (the default) since the last level 0 or 1, in CUMULATIVE mode since the last level 0. Cumulative takes more space, but a restore needs a single incremental instead of a chain.
Without block change tracking, though, a level 1 still reads every datafile to find the changed blocks: it saves space, not time. Block change tracking records in a separate file which blocks have been modified:
SQL> ALTER DATABASE ENABLE BLOCK CHANGE TRACKING USING FILE '/opt/oracle/oradata/FREE/bct.chg';
SQL> SELECT status, filename, bytes FROM v$block_change_tracking;
STATUS FILENAME BYTES
---------- -------------------------------- ----------
ENABLED /opt/oracle/oradata/FREE/bct.chg 11599872
After the level 0 I updated 4,000 rows of a 200,000-row test table and ran a level 1. The v$backup_datafile view shows how many blocks RMAN read for each file:
FILE# LVL BCT DATAFILE_BLOCKS BLOCKS_READ BLOCKS
---------- ----- --- --------------- ----------- ----------
1 0 YES 136960 135360 116523
3 0 YES 78080 72895 58678
20 0 YES 12800 1727 1666
1 1 YES 136960 25 5
3 1 YES 78080 9 3
20 1 YES 12800 893 870
For the SYSTEM datafile (file 1) the level 1 read 25 blocks out of 136,960. The datafile of the modified table (file 20) read 893 and backed up 870. The whole level 1 job read 11 MB and wrote 3.5 MB in 6 seconds. The level 0 had taken 31 seconds for 3.12 GB: on a database of hundreds of GB, the difference between reading everything and reading only what changed is measured in hours.
One trap: RMAN still accepts levels 2, 3 and 4 from very old releases. BACKUP INCREMENTAL LEVEL 2 raises no error and produces backup sets marked “level 2”. Use only 0 and 1, and if the level comes from a script, check it before passing it to RMAN.
What changes between Free, Standard and Enterprise Edition
In my tests the Free edition ran everything, including MEDIUM compression and block change tracking, but not parallelism: with PARALLELISM 2 configured, RMAN allocates a single channel and says so explicitly with RMAN-06909: warning: parallelism require Enterprise Edition. A feature that switches on is not necessarily covered by your license. This is what the Oracle AI Database 26ai licensing guide says about the features used in this guide:
| Feature | Free | Standard Edition 2 | Enterprise Edition |
|---|---|---|---|
| RMAN, basic backup and recovery | yes | yes | yes |
| BASIC compression (default) | yes | yes | yes |
| LOW / MEDIUM / HIGH compression | yes (Advanced Compression included) | no | Advanced Compression, extra-cost option |
| Block change tracking | yes | no | yes |
| Parallel backup and recovery | no | no | yes |
In practice: on Standard Edition 2 use BASIC compression and no block change tracking, so incrementals read every datafile. On Enterprise Edition without Advanced Compression, stay on BASIC, even though CONFIGURE COMPRESSION ALGORITHM 'MEDIUM' is accepted without complaint: the usage is recorded in the feature usage statistics and counts in an audit. The Free edition has resource limits (the same guide mentions 2 CPUs, 2 GB of RAM and 12 GB of user data): it is fine for learning and for rehearsing procedures, not for sizing production backup times.
LIST, REPORT, CROSSCHECK and DELETE: keeping the repository clean
RMAN records every backup in the control file (or in a recovery catalog, if you use one). LIST shows what is there, REPORT compares it with the retention:
RMAN> LIST BACKUP SUMMARY;
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
1 B A A DISK 26-OCT-26 1 1 YES L0_TEST
2 B 0 A DISK 26-OCT-26 1 1 YES TAG20261026T151606
...
6 B F A DISK 26-OCT-26 1 1 YES TAG20261026T151633
8 B 1 A DISK 26-OCT-26 1 1 YES L1_TEST
RMAN> REPORT NEED BACKUP;
Report of files that must be backed up to satisfy 7 days recovery window
File Days Name
---- ----- -----------------------------------------------------
RMAN> REPORT OBSOLETE;
RMAN retention policy is set to recovery window of 7 days
no obsolete backups found
In the LV column, A means archived log, 0 and 1 are the incremental levels, F is the control file and SPFILE autobackup. An empty REPORT NEED BACKUP means the retention is satisfied.
CROSSCHECK checks that the recorded files still exist. To simulate it I deleted an archived log by hand from the filesystem, which is what happens when someone “frees up space” without going through RMAN:
RMAN> CROSSCHECK ARCHIVELOG ALL;
validation failed for archived log
archived log file name=/opt/oracle/oradata/fra/FREE/archivelog/2026_10_26/o1_mf_1_1_ofyvnm1q_.arc RECID=1
validation succeeded for archived log
...
Crosschecked 11 objects
RMAN> DELETE NOPROMPT EXPIRED ARCHIVELOG ALL;
deleted archived log
archived log file name=/opt/oracle/oradata/fra/FREE/archivelog/2026_10_26/o1_mf_1_1_ofyvnm1q_.arc RECID=1
Deleted 1 EXPIRED objects
DELETE EXPIRED only removes from the repository the entries for files that no longer exist. DELETE OBSOLETE, on the other hand, actually deletes the files the retention no longer requires. With the 7-day window nothing was obsolete; forcing a REDUNDANCY 1 retention after a second level 0 gave this result:
RMAN> DELETE NOPROMPT OBSOLETE REDUNDANCY 1;
Deleting the following obsolete backups and copies:
...
Deleted 30 objects
RMAN> LIST BACKUP SUMMARY;
Key TY LV S Device Type Completion Time #Pieces #Copies Compressed Tag
------- -- -- - ----------- --------------- ------- ------- ---------- ---
4 B 0 A DISK 26-OCT-26 1 1 YES TAG20261026T151606
23 B 0 A DISK 26-OCT-26 1 1 YES CRON_L0
24 B 0 A DISK 26-OCT-26 1 1 YES CRON_L0
25 B A A DISK 26-OCT-26 1 1 YES CRON_L0
26 B F A DISK 26-OCT-26 1 1 YES TAG20261026T151959
Backup set 4 from the first level 0 survived, and rightly so: it contains PDB$SEED, which the second level 0 skipped thanks to backup optimization. That backup set is the only copy of those datafiles, so it is not obsolete.
Another surprise: with ARCHIVELOG DELETION POLICY TO BACKED UP 1 TIMES TO DISK the archived logs that have been backed up stay in the FRA. The policy makes them eligible for deletion, it does not delete them: RMAN removes them when the FRA needs space, or when you ask for it with DELETE ARCHIVELOG ALL BACKED UP 1 TIMES TO DISK or with DELETE INPUT in the backup command.
Verifying backups: VALIDATE and RESTORE … VALIDATE
A backup you have never tried to read is a hypothesis. RMAN offers two different checks that are often confused:
RMAN> VALIDATE CHECK LOGICAL DATABASE;
File Status Marked Corrupt Empty Blocks Blocks Examined High SCN
---- ------ -------------- ------------ --------------- ----------
1 OK 0 21613 136962 2120329
...
20 OK 0 11139 12800 2120264
File Name: /opt/oracle/oradata/FREE/FREEPDB1/dati_test01.dbf
...
Control File OK 0 1146
VALIDATE DATABASE checks the datafiles in use, not the backups: it looks for physically corrupt blocks and, with CHECK LOGICAL, for logical inconsistencies too. Any corrupt blocks are listed in v$database_block_corruption. To verify that the backups can be used, you need the other form:
RMAN> RESTORE DATABASE VALIDATE;
channel ORA_DISK_1: starting validation of datafile backup set
channel ORA_DISK_1: reading from backup piece .../o1_mf_nnnd0_TAG20261026T151606_ofyvopwo_.bkp
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: validation complete, elapsed time: 00:00:03
...
Finished restore at 26-OCT-26
Here RMAN picks the backups it would use for a real restore, reads them in full and checks the blocks, without writing anything. Two details from the output worth knowing. First: it read only the level 0 backup sets, because incrementals are applied during RECOVER, not RESTORE. Second: RESTORE ARCHIVELOG ALL VALIDATE read the archived logs still on disk (scanning archived log ...arc), not their backups. If you want to be sure about the archived log backup sets, validate them by key with VALIDATE BACKUPSET <key>. On my database the three checks together took 22 seconds.
Recovering a lost datafile
The most useful test: after the level 1 backup I inserted another 5,000 rows (205,000 in total), then deleted the test tablespace datafile while the database was open.
$ rm /opt/oracle/oradata/FREE/FREEPDB1/dati_test01.dbf
SQL> select count(*) from app.ordini;
ORA-01116: error in opening database file 20
ORA-01110: data file 20: '/opt/oracle/oradata/FREE/FREEPDB1/dati_test01.dbf'
ORA-27041: unable to open file
Linux-x86_64 Error: 2: No such file or directory
The first attempt, connected to the CDB root as you usually would, failed on every command:
$ rman target /
RMAN> ALTER DATABASE DATAFILE 20 OFFLINE;
ORA-01516: nonexistent log file, data file, or temporary file "20" in the current container
RMAN> RESTORE DATAFILE 20;
ORA-19573: cannot obtain exclusive enqueue for datafile 20
ORA-19890: data file already in use
The datafile belongs to the PDB, so it cannot be taken offline from the root, and RMAN cannot restore a file that is still in use. The fix is to connect directly to the PDB:
$ rman target "sys@localhost:1521/FREEPDB1"
connected to target database: FREE:FREEPDB1 (DBID=3196615066)
RMAN> ALTER DATABASE DATAFILE 20 OFFLINE;
Statement processed
RMAN> RESTORE DATAFILE 20;
channel ORA_DISK_1: restoring datafile 00020 to /opt/oracle/oradata/FREE/FREEPDB1/dati_test01.dbf
channel ORA_DISK_1: reading from backup piece .../o1_mf_nnnd0_TAG20261026T151606_ofyvp64m_.bkp
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
Finished restore at 26-OCT-26
RMAN> RECOVER DATAFILE 20;
channel ORA_DISK_1: starting incremental datafile backup set restore
channel ORA_DISK_1: reading from backup piece .../o1_mf_nnnd1_L1_TEST_ofyvq1y7_.bkp
starting media recovery
media recovery complete, elapsed time: 00:00:01
Finished recover at 26-OCT-26
RMAN> ALTER DATABASE DATAFILE 20 ONLINE;
Statement processed
SQL> select count(*) from app.ordini;
COUNT(*)
----------
205000
This is the sequence to remember: RESTORE puts back the level 0, RECOVER applies the level 1 and then the redo (archived and online) up to the last commit. All 5,000 rows inserted after the last backup are there, and the rest of the database stayed open the whole time. Ten seconds in total, on a small file.
Point-in-time recovery of a PDB after a human error
The second classic scenario is not a failure but a wrong command. I noted the time and emptied the table:
SQL> select to_char(sysdate,'YYYY-MM-DD HH24:MI:SS') t from dual;
2026-10-26 15:20:28
SQL> truncate table app.ordini;
Table truncated.
In a CDB you can take a single PDB back in time without touching the others:
RMAN> ALTER PLUGGABLE DATABASE FREEPDB1 CLOSE IMMEDIATE;
RMAN> RUN {
2> SET UNTIL TIME "TO_DATE('2026-10-26 15:20:28','YYYY-MM-DD HH24:MI:SS')";
3> RESTORE PLUGGABLE DATABASE FREEPDB1;
4> RECOVER PLUGGABLE DATABASE FREEPDB1;
5> }
channel ORA_DISK_1: restoring datafile 00016 to /opt/oracle/oradata/FREE/FREEPDB1/system01.dbf
...
starting media recovery
media recovery complete, elapsed time: 00:00:00
Finished recover at 26-OCT-26
RMAN> ALTER PLUGGABLE DATABASE FREEPDB1 OPEN RESETLOGS;
Statement processed
SQL> select count(*) from app.ordini;
205000
Fourteen seconds. In production the time depends on the size of the PDB and on how much redo has to be applied. The weak point of PITR is the timestamp: if it is approximate, you recover too little or too much. When you can, get the exact SCN from the alert log or with LogMiner and use SET UNTIL SCN. Everything that happened in the PDB after that moment is lost, so for a single object consider first, on Enterprise Edition, Flashback Table or RECOVER TABLE.
Losing the control file: restore from autobackup
The control file is the map of the database: it lists datafiles and redo logs and, without a recovery catalog, it also holds the backup records. To test its loss I took a new level 0, inserted another 5,000 rows (205,000 in total) and deleted both copies of the control file:
$ rm -v /opt/oracle/oradata/FREE/control01.ctl /opt/oracle/oradata/FREE/control02.ctl
removed '/opt/oracle/oradata/FREE/control01.ctl'
removed '/opt/oracle/oradata/FREE/control02.ctl'
SQL> alter system checkpoint;
System altered.
SQL> select status from v$instance;
STATUS
------------
OPEN
The database stayed open: on Linux a deleted file remains accessible to the processes that already had it open. The problem shows up in the alert log, where the archiver can no longer update the control file:
Errors in file /opt/oracle/diag/rdbms/free/FREE/trace/FREE_arc3_698.trc:
ORA-00210: cannot open the specified control file
ORA-00202: control file: '/opt/oracle/oradata/FREE/control01.ctl'
ORA-27041: unable to open file
This is the most dangerous moment: anyone who only checks that the database responds sees nothing wrong, but archived logs are no longer being produced. At the next restart the instance stops in NOMOUNT:
SQL> shutdown abort
SQL> startup
ORACLE instance started.
ORA-00205: error in identifying control file, check alert log for more info
With autobackup enabled and a FRA, the restore takes four commands:
RMAN> RESTORE CONTROLFILE FROM AUTOBACKUP;
recovery area destination: /opt/oracle/oradata/fra
database name (or database unique name) used for search: FREE
channel ORA_DISK_1: AUTOBACKUP /opt/oracle/oradata/fra/FREE/autobackup/2026_10_26/o1_mf_s_1247677783_ofz2bqrx_.bkp found in the recovery area
channel ORA_DISK_1: control file restore from AUTOBACKUP complete
output file name=/opt/oracle/oradata/FREE/control01.ctl
output file name=/opt/oracle/oradata/FREE/control02.ctl
RMAN> ALTER DATABASE MOUNT;
RMAN> RECOVER DATABASE;
Starting implicit crosscheck backup at 26-OCT-26
Crosschecked 5 objects
searching for all files in the recovery area
cataloging files...
starting media recovery
archived log for thread 1 with sequence 3 is already on disk as file /opt/oracle/oradata/FREE/redo03.log
archived log for thread 1 with sequence 4 is already on disk as file /opt/oracle/oradata/FREE/redo01.log
media recovery complete, elapsed time: 00:00:01
RMAN> ALTER DATABASE OPEN RESETLOGS;
Statement processed
real 0m12.821s
After opening, the count is back to 205,000 rows: no data lost. Two details from the output. RMAN looked for the autobackup in the FRA by database name and, after the mount, recataloged the FRA files on its own, because the restored control file did not know about backups taken after the autobackup. And recovery read sequences 3 and 4 directly from the online redo logs: sequence 3 had never been archived, precisely because of the ORA-00210 error. Had the online redo logs been lost together with the control file, recovery would have stopped earlier and those transactions would be gone.
After a control file restore, opening always requires RESETLOGS, even when recovery is complete.
After OPEN RESETLOGS: incarnations and earlier backups
Every OPEN RESETLOGS creates a new incarnation of the database:
RMAN> LIST INCARNATION OF DATABASE;
List of Database Incarnations
DB Key Inc Key DB Name DB ID STATUS Reset SCN Reset Time
------- ------- -------- ---------------- --- ---------- ----------
1 1 FREE 1514744670 PARENT 1 05-JUL-26
2 2 FREE 1514744670 PARENT 2084882 30-AUG-26
3 3 FREE 1514744670 CURRENT 2120036 26-OCT-26
Many guides claim that after a RESETLOGS earlier backups become unusable. That has not been true since Oracle 10g: right after opening, RESTORE DATABASE VALIDATE picked and read without errors the level 0 taken before the RESETLOGS. A new full backup is still needed, for a concrete reason: the archived log chain has a gap (sequence 3 was never archived), and a restore from the old level 0 could not get all the way to the present. In the test I immediately took a level 0 tagged L0_DOPO_RESETLOGS.
Full restore on another server: DBID, SPFILE and control file
The worst case is losing the whole server: only the backups are left. To test it I used a second container with the same Oracle software, copied the contents of the first container’s FRA into /opt/oracle/backup_da_a and deleted everything else: datafiles, control files, redo logs and SPFILE.
You need the DBID of the source database. You find it on the first line of every RMAN session (connected to target database: FREE (DBID=1514744670)), and therefore in the backup logs, or in v$database while the database still exists. Write it down in your disaster recovery documentation: autobackup names in the FRA, such as o1_mf_s_1247678003_ofz2kmg9_.bkp, do not contain it.
RMAN> SET DBID 1514744670;
RMAN> STARTUP NOMOUNT;
startup failed: ORA-01078: failure in processing system parameters
LRM-00109: could not open parameter file '/opt/oracle/product/26ai/dbhomeFree/dbs/initFREE.ora'
starting Oracle instance without parameter file for retrieval of spfile
Oracle instance started
RMAN> RESTORE SPFILE FROM '/opt/oracle/backup_da_a/fra/FREE/autobackup/2026_10_26/o1_mf_s_1247678003_ofz2kmg9_.bkp';
channel ORA_DISK_1: SPFILE restore from AUTOBACKUP complete
RMAN> STARTUP FORCE NOMOUNT;
RMAN-04014: startup failed: ORA-01261: Parameter db_recovery_file_dest destination string cannot be translated
ORA-01262: Stat failed on a file destination directory
Linux-x86_64 Error: 2: No such file or directory
The first error is expected: with no parameters, RMAN starts a minimal instance just to retrieve the SPFILE. The second is the classic trap of a restore on another server: the restored SPFILE points to directories that do not exist on the new server, in this case the FRA. Create it first (mkdir -p /opt/oracle/oradata/fra); the same goes for audit_file_dest and any path that differs between the two servers. Then carry on:
RMAN> STARTUP NOMOUNT;
RMAN> RESTORE CONTROLFILE FROM '/opt/oracle/backup_da_a/fra/FREE/autobackup/2026_10_26/o1_mf_s_1247678003_ofz2kmg9_.bkp';
output file name=/opt/oracle/oradata/FREE/control01.ctl
output file name=/opt/oracle/oradata/FREE/control02.ctl
RMAN> ALTER DATABASE MOUNT;
RMAN> CATALOG START WITH '/opt/oracle/backup_da_a/' NOPROMPT;
List of Cataloged Files
=======================
File Name: /opt/oracle/backup_da_a/fra/FREE/backupset/2026_10_26/o1_mf_nnnd0_L0_DOPO_RESETLOGS_ofz2hjgj_.bkp
...
RMAN> RESTORE DATABASE;
channel ORA_DISK_1: restoring datafile 00001 to /opt/oracle/oradata/FREE/system01.dbf
...
channel ORA_DISK_1: reading from backup piece /opt/oracle/backup_da_a/fra/FREE/backupset/2026_10_26/o1_mf_nnnd0_L0_DOPO_RESETLOGS_ofz2hjgj_.bkp
...
Finished restore at 26-OCT-26
RMAN> RECOVER DATABASE;
archived log file name=/opt/oracle/backup_da_a/fra/FREE/archivelog/2026_10_26/o1_mf_1_2_ofz2kksx_.arc thread=1 sequence=2
unable to find archived log
archived log thread=1 sequence=3
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 3 and starting SCN of 2122197
RMAN> ALTER DATABASE OPEN RESETLOGS;
Statement processed
CATALOG START WITH registers in the control file the backups that sit in a different path from the original one: without this step RMAN would look for the files where it wrote them on the first server. The RMAN-06054 error at the end of recovery is not a failure: RMAN applied every available archived log and is asking for the next one, which does not exist because the online redo logs stayed on the lost server. To avoid it you can set the limit in advance, with SET UNTIL SEQUENCE 3 in a RUN block (it stops before sequence 3).
SQL> select dbid, name, open_mode from v$database;
DBID NAME OPEN_MODE
---------- --------- --------------------
1514744670 FREE READ WRITE
SQL> select count(*) from app.ordini;
206000
All 206,000 rows are there, including the 1,000 inserted just before the copied backup. Oracle recreates the tempfiles on open (in the alert log: Re-creating tempfile /opt/oracle/oradata/FREE/temp01.dbf). Restore and recovery took 1 minute 42 seconds for about 3 GB of datafiles.
In my test the paths were identical on both servers. If the new server has a different directory layout, inside the RUN block you add SET NEWNAME FOR DATABASE TO '/new/path/%U' before RESTORE and SWITCH DATAFILE ALL before RECOVER, as described in the Backup and Recovery User’s Guide. I did not run this variant. With the %b format (file name only), be careful with CDBs: the root, PDB$SEED and every PDB all have a system01.dbf. If instead you need a working copy alongside the original, for example a test environment, the right tool is DUPLICATE, which also assigns a new DBID.
Data Recovery Advisor: gone in 26ai
Many guides still suggest LIST FAILURE, ADVISE FAILURE and REPAIR FAILURE. In 26ai they are unknown commands:
RMAN> LIST FAILURE;
RMAN-00558: error encountered while parsing input commands
RMAN-01009: syntax error: found "failure": expecting one of: "all, archivelog, backed, ..."
Data Recovery Advisor had been deprecated since 19c, and the Oracle AI Database 26ai upgrade guide lists it among desupported features, with no replacement. If your runbooks use REPAIR FAILURE, rewrite them with explicit RESTORE/RECOVER before you upgrade.
Backup script for cron
The script I used in the container, tested both on success and on failure. It runs as the oracle user with the level as its argument:
#!/bin/bash
# rman_backup.sh 0|1 - incremental RMAN backup, run from cron as the oracle user
set -u
LEVEL=${1:-}
# RMAN still accepts the old levels 2-4 without errors: better to stop them here
case $LEVEL in 0|1) ;; *) echo "usage: $0 0|1" >&2; exit 2;; esac
export ORACLE_SID=FREE
export ORACLE_HOME=/opt/oracle/product/26ai/dbhomeFree
export PATH=$ORACLE_HOME/bin:$PATH
export NLS_DATE_FORMAT='YYYY-MM-DD HH24:MI:SS'
LOGDIR=/opt/oracle/backup_logs
LOG=$LOGDIR/rman_L${LEVEL}_$(date +%Y%m%d_%H%M).log
mkdir -p "$LOGDIR"
# one backup at a time: cron does not know whether the previous one is still running
exec 9>/tmp/rman_backup.lock
flock -n 9 || { echo "backup already running" >>"$LOG"; exit 1; }
rman target / log="$LOG" <<RMAN
BACKUP INCREMENTAL LEVEL $LEVEL TAG 'CRON_L$LEVEL' DATABASE PLUS ARCHIVELOG;
CROSSCHECK BACKUP;
CROSSCHECK ARCHIVELOG ALL;
DELETE NOPROMPT OBSOLETE;
DELETE NOPROMPT EXPIRED BACKUP;
EXIT;
RMAN
RC=$?
# rman exits with 1 on error, but check the log too: that is where ORA-/RMAN- end up
if [ $RC -ne 0 ] || grep -qE '^(RMAN-00569|ORA-)' "$LOG"; then
echo "RMAN backup L$LEVEL FAILED on $HOSTNAME, log: $LOG" >&2
exit 1
fi
find "$LOGDIR" -name 'rman_*.log' -mtime +30 -delete
The error message goes to stderr, so cron mails it to the user (if the server has an MTA) or your monitoring system picks it up. The non-obvious choices: NLS_DATE_FORMAT puts date and time in the log instead of just 26-OCT-26; flock prevents a slow level 0 from overlapping with the next incremental; the grep looks for RMAN-00569, the “ERROR MESSAGE STACK FOLLOWS” line that RMAN prints only for real errors, and not for warnings such as RMAN-06909. In the test an invalid level was rejected with exit=2 and the usage message, an RMAN error produced exit=1 with the failure message, and a successful level 0 returned exit=0.
The oracle user’s crontab, with level 0 on Sunday and level 1 on the other days:
30 1 * * 0 /opt/oracle/rman_backup.sh 0
30 1 * * 1-6 /opt/oracle/rman_backup.sh 1
The daily check is done on the database, not on the log files. The v$rman_backup_job_details view summarizes every job:
SELECT to_char(start_time,'DD/MM HH24:MI:SS') inizio, input_type, status,
input_bytes_display, output_bytes_display, round(compression_ratio,1) ratio, time_taken_display
FROM v$rman_backup_job_details ORDER BY start_time;
INIZIO INPUT_TYPE STATUS IN_SIZE OUT_SIZE RATIO DURATA
-------------- ------------ ---------- ---------- ---------- ------ --------
26/10 15:16:02 DB INCR COMPLETED 3.12G 449.74M 7.1 00:00:31
26/10 15:16:46 DB INCR COMPLETED 11.35M 3.53M 3.2 00:00:06
26/10 15:19:33 DB INCR COMPLETED 2.31G 343.90M 6.9 00:00:25
A STATUS other than COMPLETED (FAILED, COMPLETED WITH WARNINGS, COMPLETED WITH ERRORS) or a day with no rows are the two alerts to set up in monitoring. The 7:1 compression ratio depends on the data: a table of numbers and repetitive strings compresses far better than already-compressed LOBs. For a broader routine of checks, see the Oracle DBA daily checks.
Common errors and how to fix them
| Error or symptom | Cause | Fix |
|---|---|---|
ORA-01516 on ALTER DATABASE DATAFILE n OFFLINE |
You are connected to the root and the datafile belongs to a PDB | Connect RMAN to the PDB (rman target sys@host/PDB) or work at the level of the whole PDB |
ORA-19573 / ORA-19890 on restore |
The datafile is still online or in use | Take the datafile offline or close the PDB before RESTORE |
RMAN-06094: datafile n must be restored |
RECOVER run without a successful RESTORE |
Fix the restore error and repeat the sequence |
ORA-00205 at startup, ORA-00210 in the alert log |
Control files missing or unreadable | STARTUP NOMOUNT, RESTORE CONTROLFILE FROM AUTOBACKUP, mount, RECOVER DATABASE, OPEN RESETLOGS |
ORA-01261 / ORA-01262 at startup on another server |
The restored SPFILE points to directories that do not exist (FRA, audit) | Create the directories or fix the parameters, then repeat the startup |
RMAN-06054: media recovery requesting unknown archived log |
Recovery reached the last available archived log | Normal when the online redo logs are lost: OPEN RESETLOGS, or SET UNTIL SEQUENCE in advance |
RMAN-06909: parallelism require Enterprise Edition |
PARALLELISM greater than 1 on Free or SE2 |
Just a warning: go back to PARALLELISM 1 for clean logs |
RMAN-01009: syntax error on LIST FAILURE |
Data Recovery Advisor removed in 26ai | Use explicit RESTORE/RECOVER |
| TAG only on the archived logs | TAG written after PLUS ARCHIVELOG |
Put the TAG before DATABASE |
| Database hung, archiving stopped | FRA or archived log destination full | Free up space with DELETE ARCHIVELOG ... BACKED UP and increase db_recovery_file_dest_size; never rm by hand |
Archived logs deleted with rm |
The repository still thinks they exist | CROSSCHECK ARCHIVELOG ALL and DELETE EXPIRED ARCHIVELOG ALL, then a new level 0 backup right away |
The last row deserves attention: a missing archived log breaks the redo chain. Recovery can only go as far as the gap, so after an incident like this you need a new level 0 to start over with a complete chain.
RMAN command summary
| Command | What it is for |
|---|---|
SHOW ALL |
Persistent configuration and defaults |
BACKUP INCREMENTAL LEVEL 0 DATABASE PLUS ARCHIVELOG |
Full base for incrementals, with archived logs |
BACKUP INCREMENTAL LEVEL 1 [CUMULATIVE] DATABASE |
Only the blocks changed since the last level 1 (or level 0 if cumulative) |
LIST BACKUP SUMMARY |
List of backups in the repository |
REPORT NEED BACKUP / REPORT OBSOLETE |
Comparison with the retention policy |
CROSSCHECK BACKUP / ARCHIVELOG ALL |
Checks that the recorded files exist |
DELETE OBSOLETE / DELETE EXPIRED |
Deletes unneeded files / the entries of missing files |
VALIDATE CHECK LOGICAL DATABASE |
Looks for corrupt blocks in the datafiles in use |
RESTORE DATABASE VALIDATE |
Reads the backups as in a restore, without writing |
RESTORE + RECOVER DATAFILE n |
Recovers a single file with the database open |
SET UNTIL TIME / SCN + RESTORE/RECOVER PLUGGABLE DATABASE |
Point-in-time recovery of a PDB |
RESTORE CONTROLFILE FROM AUTOBACKUP |
Restores the control file (instance in NOMOUNT) |
SET DBID + RESTORE SPFILE FROM '<piece>' |
Recovers the parameters when nothing else is left |
CATALOG START WITH '<dir>' |
Registers backups copied to another path |
LIST INCARNATION |
History of the database’s RESETLOGS operations |
The full syntax of every command is in Oracle’s Backup and Recovery Reference, and the strategies in the Backup and Recovery User’s Guide.
Frequently Asked Questions
What is Oracle RMAN?
RMAN, Recovery Manager, is the command-line client included with Oracle Database for physical backup and recovery. It copies datafiles, archived logs, control files and the SPFILE, records every backup in the control file and, at restore time, decides by itself which backups and which redo to apply to get back to the requested point in time.
What is the difference between RMAN and Data Pump?
Data Pump exports objects and data in logical format and brings them back to the moment of the export: it is good for migrating schemas or copying tables between databases. RMAN copies the physical blocks and, together with the archived logs, can recover the whole database or a single file up to the last commit or to a precise moment. RMAN backups are taken with the database open, as long as it is in ARCHIVELOG mode. For disaster recovery you need RMAN.
What is the difference between RESTORE and RECOVER in RMAN?
RESTORE copies the lost or damaged files back from the backups, whether datafiles, control files or the SPFILE, bringing them back to the state of the backup. RECOVER then applies the incremental backups and the redo logs, archived and online, to bring those files up to the last commit or to the requested moment. A full recovery always needs both, in that order.
How often should you run level 0 and level 1 backups?
The most common schedule is a level 0 every week and a level 1 every night, with more frequent archived log backups if the data changes a lot. The right frequency depends on how much data you can afford to lose and how long you can spend on the restore: more differential incrementals to apply mean a longer recovery.
Does RMAN work on Standard Edition and on the Free version?
Yes, backup and recovery with RMAN are available in every edition. Standard Edition 2 lacks block change tracking, parallel backup and the LOW, MEDIUM and HIGH compression algorithms. The Free version includes block change tracking and Advanced Compression but not parallelism, and has CPU, memory and data limits that make it suitable for testing and training.