What is RMAN? A Complete Guide to the Basics of Oracle’s Standard Backup & Recovery Tool!

Bronze_en

When handling Oracle Database, designing Oracle backup and recovery is unavoidable. The central role in this is played by Oracle’s standard utility, “RMAN (Recovery Manager)“.

In this article, we will explain the mechanism, features, capabilities, and usage examples of RMAN, as well as the procedure to change to “ARCHIVELOG mode” which is essential for production operations. This guide is designed for beginners with diagrams and detailed command explanations. Let’s resolve doubts like “I don’t understand what the commands mean” or “What is the difference from SQL*Plus?”.

Conclusion: What RMAN Can Do (Summary)

Once you master RMAN, the following management tasks can be completed with standard commands:

  • Integrated Management: Centralized management of data files, control files, and archived redo logs.
  • Efficiency: Backs up only used blocks (compression and speed).
  • Safety: Detects corrupt blocks during backup.
  • Automation: Standardizes routine processing combined with shell scripts, etc.

1. What is RMAN? Mechanisms and Features

RMAN (Recovery Manager) is a command-line tool dedicated to backup and recovery provided by Oracle as a standard feature.

Positioning of RMAN

Organized in a text diagram, the positioning is as follows:

┌──────────────┐
│  Positioning of RMAN     │
├──────────────┤
│ Official Backup/Recovery │
│ Tool provided by Oracle  │
└──────────────┘

Unlike SQL*Plus, RMAN can efficiently handle data files and control files in “physical file units”, manage archived redo logs, and automate recovery operations, which are its greatest features. RMAN is essential for “complete recovery to the point just before failure,” which cannot be handled by logical backups (Data Pump / expdp).

Main Features and Merits of RMAN

FeatureExplanation
Oracle Standard ToolOfficially provided by Oracle, available without additional licensing.
Block-level BackupBacks up only “used blocks” containing data, saving capacity and time.
Archive Log ManagementCan automatically delete archived redo logs that are no longer needed simultaneously with backup acquisition.
Complete Recovery on FailureEnables recovery of transactions to the moment just before the failure using backups + REDO logs / archived redo logs.
Auto-scriptingEasy to automate operations through scheduled execution or integration with OS shell scripts.
History Management via CatalogUsing a “Recovery Catalog” allows for centralized management of long-term backup history.

What RMAN Can Do

With just RMAN, almost all operations necessary for database preservation are possible.

✅ Backup of the entire database

✅ Backup by data file unit

✅ Backup and deletion of archived redo logs

✅ Backup of control file / SPFILE

✅ Incomplete recovery (specification by Time / SCN / Log Sequence)

✅ Verification of backup data (VALIDATE), Restore


2. [Essential Setting] Procedure to Change to ARCHIVELOG Mode

To fully utilize RMAN features and take backups without stopping operations (online backup), the database must be set to ARCHIVELOG mode.

By default (NOARCHIVELOG mode), backups can only be taken when the DB is stopped. Change it using the following procedure.

Note: This operation requires a database restart.

Step 1: Check the current mode

Connect as an administrator via SQL*Plus and check the current status.

SQL> CONNECT / AS SYSDBA
SQL> SELECT LOG_MODE FROM V$DATABASE;

LOG_MODE
------------
NOARCHIVELOG

If NOARCHIVELOG is displayed, a change is required.

Step 2: Stop the database and start in MOUNT state

To change the setting, stop the instance once and start it in the MOUNT state (before opening data files).

-- Shut down the database cleanly
SQL> SHUTDOWN IMMEDIATE

-- Start in MOUNT state (to change settings)
SQL> STARTUP MOUNT

Step 3: Change to ARCHIVELOG mode and open the DB

Change the mode and open the database.

-- Change to ARCHIVELOG mode
SQL> ALTER DATABASE ARCHIVELOG;

-- Open the database (make it available)
SQL> ALTER DATABASE OPEN;

Step 4: Confirm the change result

Check the mode again.

SQL> SELECT LOG_MODE FROM V$DATABASE;

LOG_MODE
------------
ARCHIVELOG

If it says “ARCHIVELOG”, the setting is complete. Online backup via RMAN is now possible.

SQL> SELECT LOG_MODE FROM V$DATABASE;

LOG_MODE
------------
NOARCHIVELOG

SQL> SHUTDOWN IMMEDIATE
Database closed.
Database dismounted.
ORACLE instance shut down.
SQL> STARTUP MOUNT
ORACLE instance started.

Total System Global Area 1543500144 bytes
Fixed Size 8896880 bytes
Variable Size 889192448 bytes
Database Buffers 637534208 bytes
Redo Buffers 7876608 bytes
Database mounted.
SQL> ALTER DATABASE ARCHIVELOG;

Database altered.

SQL> ALTER DATABASE OPEN;

Database altered.

SQL> SELECT LOG_MODE FROM V$DATABASE;

LOG_MODE
------------
ARCHIVELOG ★

3. Practice: Backup Operations with RMAN

Here we explain actual command examples and their “intent/results” in detail.

Prerequisite Environment:

  • OS: Oracle Linux / Windows
  • User: Logged in to OS as oracle user
  • Connection Target: Local database (ORACLE_SID configured)
  • Backup Destination Directory: /backup (Must have write permissions)

Step 1: Connect to RMAN

First, start RMAN from the OS terminal and connect to the target database.

# Execute from OS command line
$ rman target /
  • Explanation: target / means “Connect to the local target database with SYSDBA (or SYSBACKUP) privileges using OS authentication.” Password entry can be omitted.
  • Result: The RMAN> prompt is displayed, and it enters a waiting state for input.

Step 2: Backup of the entire database

This is the most basic backup of the “entire database (data files + control file + SPFILE)”.

RMAN> BACKUP DATABASE FORMAT '/backup/backup_%U.bkp';

[Command Explanation]

  • BACKUP DATABASE: Backs up all data files constituting the database. Depending on settings, the control file and SPFILE are also automatically included.
  • FORMAT '/backup/...': Specifies the output destination and naming convention for backup files.
  • %U: Important. Replaced by a “unique ID (unique string)” automatically generated by Oracle. This specification is usually included to prevent file name duplication errors.

Backup pieces (physical files) are created in the specified directory.

Files processed are displayed like “input datafile file number=00001 …”.

[oracle@orcl19c ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Jan 14 19:41:42 2026
Version 19.3.0.0.0

Copyright (c) 1982, 2019, Oracle and/or its affiliates. All rights reserved.

connected to target database: ORCL (DBID=1734656221)

RMAN> BACKUP DATABASE FORMAT '/backup/backup_%U.bkp'; ★

Starting backup at 14-JAN-26
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=71 device type=DISK
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
input datafile file number=00001 name=/u01/app/oracle/oradata/ORCL/system01.dbf
input datafile file number=00003 name=/u01/app/oracle/oradata/ORCL/sysaux01.dbf
input datafile file number=00004 name=/u01/app/oracle/oradata/ORCL/undotbs01.dbf
input datafile file number=00007 name=/u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: starting piece 1 at 14-JAN-26
channel ORA_DISK_1: finished piece 1 at 14-JAN-26
piece handle=/backup/backup_014dt343_1_1.bkp tag=TAG20260114T194155 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:01:46
Finished backup at 14-JAN-26

Starting Control File and SPFILE Autobackup at 14-JAN-26
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1734656221-20260114-00 comment=NONE
Finished Control File and SPFILE Autobackup at 14-JAN-26

RMAN>

Step 3: Backup and Deletion of Archive Logs

Back up the ever-increasing archive logs and delete the completed ones to prevent disk pressure.

RMAN> BACKUP ARCHIVELOG ALL DELETE INPUT;

[Command Explanation]

  • BACKUP ARCHIVELOG ALL: Targets all archive log files on the disk for backup.
  • DELETE INPUT: Important. Deletes the original archive log files from the disk once the backup is successfully completed. This prevents disk capacity exhaustion.
RMAN> BACKUP ARCHIVELOG ALL DELETE INPUT;  ★

Starting backup at 14-JAN-26
current log archived
using channel ORA_DISK_1
channel ORA_DISK_1: starting archived log backup set
channel ORA_DISK_1: specifying archived log(s) in backup set
input archived log thread=1 sequence=6 RECID=1 STAMP=1222544601
input archived log thread=1 sequence=7 RECID=2 STAMP=1222544614
input archived log thread=1 sequence=8 RECID=3 STAMP=1222544614
input archived log thread=1 sequence=9 RECID=4 STAMP=1222544617
input archived log thread=1 sequence=10 RECID=5 STAMP=1222544622
input archived log thread=1 sequence=11 RECID=6 STAMP=1222544643
channel ORA_DISK_1: starting piece 1 at 14-JAN-26
channel ORA_DISK_1: finished piece 1 at 14-JAN-26
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/034dt383_1_1 tag=TAG20260114T194403 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
channel ORA_DISK_1: deleting archived log(s)
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_6_1206875490.dbf RECID=1 STAMP=1222544601
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_7_1206875490.dbf RECID=2 STAMP=1222544614
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_8_1206875490.dbf RECID=3 STAMP=1222544614
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_9_1206875490.dbf RECID=4 STAMP=1222544617
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_10_1206875490.dbf RECID=5 STAMP=1222544622
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_11_1206875490.dbf RECID=6 STAMP=1222544643
Finished backup at 14-JAN-26

Starting Control File and SPFILE Autobackup at 14-JAN-26
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1734656221-20260114-01 comment=NONE
Finished Control File and SPFILE Autobackup at 14-JAN-26

RMAN>

Step 4: Explicit Backup of Control File

The Control File is the lifeline managing DB configuration information. Execute the following to back it up individually.

RMAN> BACKUP CURRENT CONTROLFILE;
RMAN> BACKUP CURRENT CONTROLFILE;  ★

Starting backup at 14-JAN-26
using channel ORA_DISK_1
channel ORA_DISK_1: starting full datafile backup set
channel ORA_DISK_1: specifying datafile(s) in backup set
including current control file in backup set
channel ORA_DISK_1: starting piece 1 at 14-JAN-26
channel ORA_DISK_1: finished piece 1 at 14-JAN-26
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/054dt38n_1_1 tag=TAG20260114T194423 comment=NONE
channel ORA_DISK_1: backup set complete, elapsed time: 00:00:01
Finished backup at 14-JAN-26

Starting Control File and SPFILE Autobackup at 14-JAN-26
piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/c-1734656221-20260114-02 comment=NONE
Finished Control File and SPFILE Autobackup at 14-JAN-26

RMAN>

4. Practice: Recovery Flow with RMAN

This is the procedure for recovery when a failure occurs (such as data file loss).

Basic Recovery Flow

┌──────────────┐
│  RMAN Recovery Flow      │
├──────────────┤
│① Restore Backup          │ Write data files back from backup
│② Apply Archive Logs      │ Apply REDO logs to advance to latest state (Roll Forward)
│③ Open Database           │ Open the DB in a consistent state
└──────────────┘

Execution Example: Complete Recovery of the Entire Database

This procedure assumes a serious failure where the database cannot start (only comes up to MOUNT state).

-- 1. Mount the database (if not started)
RMAN> STARTUP MOUNT;

-- 2. Restore files from backup
RMAN> RESTORE DATABASE;

-- 3. Apply archive logs/redo logs to update to latest state
RMAN> RECOVER DATABASE;

-- 4. Open the database normally
RMAN> ALTER DATABASE OPEN;

[Command Explanation]

  • RESTORE DATABASE: Copies physical files from the backup set to their original location (or specified location). It simply places “files from a past point in time.”
  • RECOVER DATABASE: Sequentially applies differential data (archive logs, REDO logs) to the RESTOREd old files (roll forward) and updates the data to the latest state just before the failure occurred.
  • ALTER DATABASE OPEN: Opens the database so users can access it after data consistency is confirmed.
RMAN> STARTUP MOUNT

connected to target database (not started)
Oracle instance started
database mounted

Total System Global Area 1543500144 bytes

Fixed Size 8896880 bytes
Variable Size 889192448 bytes
Database Buffers 637534208 bytes
Redo Buffers 7876608 bytes

RMAN> RESTORE DATABASE; ★

Starting restore at 14-JAN-26
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=39 device type=DISK

channel ORA_DISK_1: starting datafile backup set restore
channel ORA_DISK_1: specifying datafile(s) to restore from backup set
channel ORA_DISK_1: restoring datafile 00001 to /u01/app/oracle/oradata/ORCL/system01.dbf
channel ORA_DISK_1: restoring datafile 00003 to /u01/app/oracle/oradata/ORCL/sysaux01.dbf
channel ORA_DISK_1: restoring datafile 00004 to /u01/app/oracle/oradata/ORCL/undotbs01.dbf
channel ORA_DISK_1: restoring datafile 00007 to /u01/app/oracle/oradata/ORCL/users01.dbf
channel ORA_DISK_1: reading from backup piece /backup/backup_014dt343_1_1.bkp
channel ORA_DISK_1: piece handle=/backup/backup_014dt343_1_1.bkp tag=TAG20260114T194155
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:02:06
Finished restore at 14-JAN-26

RMAN> RECOVER DATABASE; ★

Starting recover at 14-JAN-26
using channel ORA_DISK_1

starting media recovery

archived log for thread 1 with sequence 12 is already on disk as file /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_12_1206875490.dbf
archived log for thread 1 with sequence 13 is already on disk as file /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_13_1206875490.dbf
archived log for thread 1 with sequence 14 is already on disk as file /u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_14_1206875490.dbf
channel ORA_DISK_1: starting archived log restore to default destination
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=6
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=7
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=8
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=9
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=10
channel ORA_DISK_1: restoring archived log
archived log thread=1 sequence=11
channel ORA_DISK_1: reading from backup piece /u01/app/oracle/product/19.0.0/dbhome_1/dbs/034dt383_1_1
channel ORA_DISK_1: piece handle=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/034dt383_1_1 tag=TAG20260114T194403
channel ORA_DISK_1: restored backup piece 1
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_6_1206875490.dbf thread=1 sequence=6
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_7_1206875490.dbf thread=1 sequence=7
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_8_1206875490.dbf thread=1 sequence=8
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_9_1206875490.dbf thread=1 sequence=9
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_10_1206875490.dbf thread=1 sequence=10
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_11_1206875490.dbf thread=1 sequence=11
archived log file name=/u01/app/oracle/product/19.0.0/dbhome_1/dbs/arch1_12_1206875490.dbf thread=1 sequence=12
media recovery complete, elapsed time: 00:00:01
Finished recover at 14-JAN-26

RMAN> ALTER DATABASE OPEN;

Statement processed

RMAN> SELECT STATUS FROM V$INSTANCE;

STATUS
------------
OPEN ★

RMAN>

5. RMAN Basic Configuration and Catalog Usage

RMAN manages history information about “when backups were taken”.

┌─────────────┐
│ Location of RMAN Info   │
├─────────────┤
│ - Control File          │ (Default) Holds history in DB's own control file
│ - Recovery Catalog(Opt) │ Saves history in a dedicated schema on another DB
└─────────────┘

In small-scale environments, the default (control file management) is sufficient. However, using a Recovery Catalog ensures that history information remains even if the target DB’s control file is entirely lost, preventing the loss of clues for recovery. Consider using a catalog for systems requiring large-scale or high reliability.


6. Troubleshooting (Common Errors)

Common errors encountered during RMAN operations and their solutions.

Error CodeCauseSolution
ORA-19504The specified backup destination path does not exist, or there are no write permissions.Create the directory on the OS side (mkdir) and grant permissions using chown etc.
ORA-01031insufficient privileges.Check if running as oracle user. Check authentication settings in sqlnet.ora.
ORA-19602Attempted online backup while not in ARCHIVELOG mode.Stop the DB and take it in MOUNT state, or change to ARCHIVELOG mode as per Step 2.

7. Operations, Monitoring, and Security Notes

  • Monitoring Disk Space: If the backup destination or Fast Recovery Area (FRA) becomes full, the DB itself may stop. Utilize the DELETE INPUT option or regularly execute the DELETE OBSOLETE command to delete old backups.
  • Password File: A password file is required for remote RMAN connections. Use the orapwd command when recreating it.
  • Encryption: If production data backup files are stolen as is, data can be restored. If security requirements are high, consider RMAN encryption features (may require Enterprise Edition option, etc.).

8. FAQ (Frequently Asked Questions)

Q1. What is the difference from SQL*Plus commands?

A. SQL*Plus primarily performs data manipulation and management, but its physical file backup functions are weak (BEGIN BACKUP etc. are old methods). RMAN is designed specifically for backup, enabling advanced management impossible with SQL*Plus, such as block corruption detection, compression, and incremental backups.

Q2. What is the difference from Data Pump (expdp)?

A. Data Pump is a “Logical Backup (data extraction)”. It is convenient for restoring specific tables, but unsuitable for returning the entire database to the state just before a failure (Complete Recovery). Always use RMAN (Physical Backup) for system protection, and use Data Pump supplementarily.

Q3. What happens if I forget “DELETE INPUT”?

A. Archive logs will continue to remain on the disk. If the disk fills up, the database cannot update, and the system stops. An operation to delete them regularly (or the auto-delete function of FRA) is necessary.


Summary: RMAN is an Essential Skill for Oracle Operations!

RMAN is a core backup & recovery tool indispensable for operating Oracle Database safely and efficiently. You may be confused by command-line operations at first, but the basic commands are simple.

Summary of RMAN Merits

✔ Safe: Can reliably acquire consistent backups.

✔ Rapid: Can backup and restore only necessary blocks.

✔ Automation: Reduces operational load through scripting.

✔ Management: History management makes it clear to which point recovery is possible.

In future articles, we will introduce more practical settings for “Incremental Backups” and how to utilize the “Fast Recovery Area (FRA)”. Please bookmark and continue learning!

Note: This article explains concepts targeting Oracle Database 19c (screens and default values may differ for other versions).


[reference]
9.2.2 RMAN Repository

コメント

Copied title and URL