Oracle RMAN Features and Fundamentals of Consistent Backups

English

In Oracle Database operations, data protection is the most critical mission. Oracle Recovery Manager (RMAN) is a powerful, built-in backup tool that enables efficient protection while maintaining database integrity.

This article summarizes the primary features of RMAN and explains in detail the differences between “Consistent” and “Inconsistent” backups—the cornerstones of operational design—along with specific execution procedures for each.

Conclusion: RMAN Backup Quick Guide (To-Do List)

Check the following points when selecting your backup method:

When to choose a Consistent Backup:

  • You can shut down the database (SHUTDOWN).
  • You are operating in NOARCHIVELOG mode.
  • You want to skip recovery operations after a restore.

When to choose an Inconsistent Backup:

  • You cannot stop the database (24/7 operations).
  • ARCHIVELOG mode is enabled (Required).
  • You need to recover data up to the point of failure.

What is RMAN? 5 Key Features

RMAN is a backup management client designed specifically for Oracle Database. Unlike OS-level copies, it allows for block-level validation and incremental backups.

  1. Block-Level Corruption Detection: Automatically checks for physical and logical corruption in data blocks during the backup process.
  2. Incremental Backups: Extracts only the data blocks changed since the previous backup, saving time and storage space.
  3. Unused Block Compression: Skips unused space within data files during the backup to minimize file size.
  4. Catalog Management: Automatically manages backup generations and expiration dates using the Control File (or a Recovery Catalog).
  5. Diverse Output Destinations: Supports direct output to disk, tape devices (SBT), and cloud storage (OCI Object Storage).

Differences Between Consistent and Inconsistent Backups

“Consistency” refers to a state where the System Change Number (SCN) across all data files and control files is identical.

ItemConsistent Backup (OFFLINE)Inconsistent Backup (ONLINE)
DB StatusMOUNT (Started after SHUTDOWN)OPEN (Running)
Log ModeNOARCHIVELOG / ARCHIVELOGARCHIVELOG (Mandatory)
DowntimeRequiredNone
RecoveryNot required (Usable after restore)Required (Applying Archive Logs)
Main Use CaseMaintenance, Small DBsMission-critical, 24/7 environments

Implementation Step 1: Taking a Consistent Backup (Offline)

The database is shut down normally and backed up while in a MOUNT state.

Prerequisites:

  • OS User: oracle
  • Privileges: SYSDBA or SYSBACKUP
  • Database Name: V19
-- Start RMAN and connect to the target DB
-- $ rman target /

-- 1. Shut down the database in a consistent state
SHUTDOWN IMMEDIATE;

-- 2. Start in MOUNT state (minimum state for backup)
STARTUP MOUNT;

-- 3. Execute full database backup
-- Note: Control files and SPFILE are automatically backed up
BACKUP DATABASE;

-- 4. Return the database to normal operational state
ALTER DATABASE OPEN;

Note: In this procedure, because all data files are static at the same SCN, the database can be started immediately after a restore.


Implementation Step 2: Taking an Inconsistent Backup (Online)

The backup is taken while the database is running, utilizing ARCHIVELOG mode.

Prerequisites:

  • ARCHIVELOG mode must be enabled.
  • Passwords should not contain special characters like “@”.
-- Start RMAN and connect
-- $ rman target /

-- 1. Verify Archivelog mode (Must be ARCHIVELOG)
SELECT LOG_MODE FROM V$DATABASE;

-- 2. Execute online backup
-- The PLUS ARCHIVELOG clause triggers log switches before/after the backup,
-- ensuring the archived logs needed for recovery are backed up as a set.
BACKUP DATABASE PLUS ARCHIVELOG;

Note: Users can continue using the DB during execution. While the SCNs in the backup files are inconsistent, the database can be restored to a consistent state by applying the archived logs captured in the set (Recovery).


Troubleshooting: Common ORA Errors

Error NumberCauseAction
ORA-19602Attempted backup while OPEN in NOARCHIVELOG modeSHUTDOWN the DB and execute in MOUNT state.
ORA-19809Fast Recovery Area (FRA) is out of spaceDelete obsolete backups (DELETE OBSOLETE) or expand FRA size.
ORA-01031Insufficient privilegesEnsure the user is in the OSDBA group or check SYSBACKUP privileges.

Operational and Security Considerations

  • Risks and Restoration: If the server fails during a backup, the original data remains intact. However, the backup files will be incomplete, so run BACKUP DATABASE again after recovery.
  • Verification: Regularly confirm that backups are successful using the LIST BACKUP; and VALIDATE DATABASE; commands.
  • Security: Backup files contain sensitive data. Consider using encryption with SET ENCRYPTION ON;.

FAQ

Q1: Can I just use OS commands to copy files instead of RMAN?

A: For a running database, you would need “User-Managed Backup” procedures (ALTER TABLESPACE BEGIN BACKUP), which are complex and error-prone. RMAN is now strongly recommended.

Q2: Can I use Incremental Backups in both modes?

A: Yes. However, they are most commonly combined with inconsistent (online) backups.

Q3: How do I delete backups?

A: Do not use the OS rm command. Use DELETE BACKUPSET <ID>; within RMAN. This ensures the management information in the control file is updated simultaneously.


Summary

  • RMAN is the optimal, high-performance, and secure backup tool for Oracle Database.
  • Consistent backups require a DB shutdown but simplify the post-restore process.
  • Inconsistent backups require ARCHIVELOG mode but allow for zero-downtime operations.
  • Choose your method based on your recovery requirements (how much data loss is acceptable).

This article is based on Oracle Database 19c (screens and default values may differ in other versions).

[reference]
Oracle Database Backup and Recovery Reference, 19c

コメント

Copied title and URL