| Lesson 4 | Creating a Whole-Database Backup with RMAN |
| Objective | Create and validate an RMAN whole-database backup. |
Explain why a Data Pump full-mode export is not complete physical protection.
A recoverable Oracle database needs physical backups, the redo required for recovery, protected configuration and encryption material, and a tested restore procedure. Oracle Recovery Manager (RMAN) coordinates the database-file portion of that protection. For an Oracle AI Database 26ai container database (CDB), RMAN can back up all data files, archived redo logs, the control file, and the server parameter file (SPFILE), then select those backups during restore and recovery.
This lesson corrects the original Export procedure that once used exp80 and INCTYPE=COMPLETE. That incremental Export mechanism
is not part of Oracle Data Pump and is not a current physical-backup method. Data Pump Export remains useful, but FULL=YES creates a logical
export of supported content in the connected database or PDB. It cannot restore lost data files or apply archived redo after media failure.
The example in this lesson is a technical starting point, not a complete production runbook. A DBA must still translate the business recovery-point objective (RPO), recovery-time objective (RTO), retention requirements, failure domains, and security requirements into tested operational procedures.
Oracle uses several similar-sounding terms for different dimensions of protection. Keeping them separate prevents a command from promising more than it can deliver.
| Term | Meaning | Important boundary |
|---|---|---|
| Data Pump full-mode export | Logical export of supported content using FULL=YES |
Not a copy of physical database files |
| Whole-database backup | RMAN backup whose scope includes all database data files | Does not automatically include every external dependency |
| Full backup | Nonincremental RMAN backup of the selected data files or database | Cannot serve as the parent of later level 1 backups |
| Incremental level 0 | Baseline RMAN backup that can parent later level 1 backups | Unrelated to original Export's retired incremental mechanism |
| Complete recovery | Recovery that applies all required available redo to the latest possible point | A recovery endpoint, not a backup type |
| Point-in-time recovery | Recovery to a specified earlier time, SCN, log sequence, or restore point | Intentionally does not recover every later change |
A backup can cover the whole database without being part of an incremental strategy. Conversely, an incremental level 0 can cover the whole database and establish the baseline for level 1 backups. Scope, block-selection method, consistency, and recovery endpoint are separate decisions.
| Requirement | Primary tool | Reason |
|---|---|---|
| Restore data files after storage loss | RMAN | RMAN backs up and restores physical database files |
| Recover changes through archived redo | RMAN | RMAN integrates backup metadata, restore, and recovery |
| Recover the database to an earlier point | RMAN | Database point-in-time recovery requires physical backups and redo |
| Move a schema or selected tables | Data Pump | Data Pump works with logical objects, rows, and metadata |
| Re-create supported definitions in another PDB | Data Pump | Import interprets exported object metadata |
| Cover physical loss and selected logical recovery | RMAN plus optional Data Pump | The tools protect different recovery units |
Calling a dump file a logical backup does not change its recovery boundary. A Data Pump export may help recover a dropped table or move an application schema, but it does not contain the physical structures and redo needed for database media recovery. Build RMAN protection first, then add Data Pump when logical portability provides a separate benefit.
Before running RMAN, document what must be recovered and how quickly. Identify the CDB and PDB scope, the maximum acceptable data loss, the maximum acceptable outage, and the retention period. Decide whether the design must survive a failed disk group, host, storage system, site, cloud region, or compromised administrative account.
The answers affect backup frequency, archived-redo handling, media type, replication, encryption, offsite placement, and testing. A fourteen-day recovery window is useful only if the required data-file backups, archived redo, control file, SPFILE, keys, credentials, and infrastructure remain available throughout that window.
A backup stored in the same failure domain as the active database does not protect against loss of that domain. The fast recovery area is an Oracle-managed disk location, but it is not automatically offsite or immutable. Additional disk copies, tape, object storage, recovery appliances, and managed recovery services have different durability, access, and recovery-time characteristics.
Oracle AI Database 26ai uses the multitenant architecture. For a whole-CDB backup that includes archived redo, connect RMAN to the CDB root as a common
user with the SYSBACKUP or SYSDBA administrative privilege. The preferred operational design uses a dedicated backup identity with
SYSBACKUP rather than routine use of SYSDBA.
The following command assumes an approved local operating-system authentication configuration and that the operating-system environment identifies the intended CDB:
rman target /
Do not place a database password in the shell command or backup script. A remote or automated implementation should use the organization's approved wallet, secret-management, or protected authentication method. Confirm the target database name and container before changing persistent settings or starting the backup.
An RMAN session connected to an individual PDB has a narrower scope. It cannot use PLUS ARCHIVELOG; archived redo backup requires a
root-connected common user with the appropriate administrative privilege. Selective PDB backup is useful, but it must not be described as a whole-CDB
backup.
From an authorized SQL session, check the current log mode:
SELECT log_mode
FROM v$database;
A database in ARCHIVELOG mode can be backed up while open. Data-file blocks can change during the operation, so the archived redo required to
make the restored files consistent must also be protected. The main procedure in this lesson follows that online-backup path.
In NOARCHIVELOG mode, a usable whole-database backup must be consistent. Shut down cleanly, mount without opening, create the backup, and then
open the database:
RMAN> SHUTDOWN IMMEDIATE;
RMAN> STARTUP MOUNT;
RMAN> BACKUP DATABASE TAG 'CONSISTENT_WHOLE_DB';
RMAN> ALTER DATABASE OPEN;
This path requires downtime and cannot reconstruct changes made after the backup from archived redo that was never generated. Do not present
NOARCHIVELOG mode as meeting an objective that requires online backups or point-in-time media recovery. Changing log mode is a planned DBA
operation outside this lesson.
Inspect persistent RMAN settings before relying on defaults:
RMAN> SHOW ALL;
RMAN stores configuration and backup records in its repository. The target control file can supply the repository for this basic workflow; a separate recovery catalog is optional. A catalog can centralize metadata and retain longer history, but its database and credentials must themselves be protected.
The following settings make two important intentions explicit:
RMAN> CONFIGURE CONTROLFILE AUTOBACKUP ON;
RMAN> CONFIGURE RETENTION POLICY TO RECOVERY WINDOW OF 14 DAYS;
Control-file autobackup creates a separate backup of the current control file and, when the target uses an SPFILE, includes the SPFILE in the same backup set. The default autobackup filename contains information that helps RMAN locate it during disaster recovery. Record any customized destination or format because recovery personnel must know how to retrieve it.
The fourteen-day recovery window is illustrative. Choose the production value from the RPO, retention requirements, backup schedule, available redo, and storage design. A retention policy determines when RMAN considers backups obsolete; it does not guarantee that every dependency is available, and it does not automatically delete obsolete files outside the fast recovery area.
Do not copy channel counts, compression settings, backup destinations, or deletion policies from a generic example. Test them against the actual CPU,
I/O, network, media manager, edition, licensing, and recovery-time requirements. In particular, do not add DELETE INPUT until archived-redo
requirements for recovery, standby apply, additional copies, and retention have been verified.
RMAN can create backup sets or image copies. A backup set is an RMAN-specific logical container written as one or more backup pieces. It can omit never-used blocks and is the normal form for disk or media-manager backups unless the configuration or command selects another form. An image copy is a data-file, control-file, or archived-log copy that RMAN can catalog and use during recovery. Neither form is universally superior.
| Design choice | Potential advantage | Planning consideration |
|---|---|---|
| Backup set | Flexible packaging for disk, tape, or supported cloud media | Restore requires RMAN to read the required backup pieces |
| Image copy | Can support switch-to-copy and incrementally updated copy strategies | Normally consumes space for a copy of the selected file |
| Fast recovery area | Oracle manages eligible recovery files according to space and policy | It is not automatically an offsite or immutable copy |
| Media manager or cloud integration | Can place backups in another storage tier or failure domain | Credentials, channels, retrieval time, cost, and vendor procedures must be tested |
RMAN channels connect the database session to the backup device. More channels or greater parallelism can improve throughput only when CPU, storage, network, and media capacity can sustain the additional work. Excessive parallelism can compete with the production workload or merely move the bottleneck. Measure backup duration and restore duration; optimizing only the backup window can leave the RTO unmet.
Encryption protects backup confidentiality but also creates a key-recovery dependency. RMAN supports encrypted backup sets, and the selected mode can depend on the database keystore, a password, or both. Choose the mode through the organization's security design, verify its Oracle edition and service requirements, and test decryption during restore. Never place an encryption password in a command line, script, log, or file stored beside the backup.
Keep at least one required backup generation outside the failure domain that contains the active database. Restrict deletion authority, monitor backup capacity and job results, and prevent one compromised credential from destroying both production files and every recovery copy. Immutability, logical air gaps, multiple administrative controls, and offline media may be appropriate when the threat model includes ransomware or malicious deletion.
For the root-connected CDB in ARCHIVELOG mode, use the following introductory command:
RMAN> BACKUP DATABASE PLUS ARCHIVELOG;
BACKUP DATABASE selects all database data files in the target scope. PLUS ARCHIVELOG coordinates archived-redo backup around the
data-file backup: RMAN archives the current redo, backs up archived logs, backs up the database, archives the current redo again, and backs up the logs
generated during the operation. Backup optimization, when enabled, can change which already-protected logs RMAN skips.
The configured channels, device type, destination, format, and backup type determine where and how RMAN writes the result. With control-file autobackup enabled, RMAN also creates the control-file/SPFILE autobackup. Review the job output to confirm each component rather than assuming that a single successful-looking line represents the entire operation.
Tags can make repository listings easier to interpret. If the operations team uses tags, label the data-file and archived-log backup specifications deliberately:
RMAN> BACKUP DATABASE TAG 'WHOLE_DB_DATA'
2> PLUS ARCHIVELOG TAG 'WHOLE_DB_REDO';
A tag is a repository label, not a filename, additional copy, retention exemption, or recovery guarantee. Use a naming standard that avoids collisions and helps operators connect the backup generation to its schedule and recovery test.
BACKUP DATABASE PLUS ARCHIVELOG protects important physical recovery inputs, but it does not capture the entire operational environment.
| Asset | Covered here? | Required action |
|---|---|---|
| Database data files | Yes | Verify all intended containers and data files are included |
| Archived redo | Yes | Retain enough redo for the required recovery window |
| Current control file | By autobackup | Verify completion, location, and retrievability |
| SPFILE | By autobackup when in use | Confirm that the target uses an SPFILE |
| TDE keystore or wallet | No | Back up separately whenever required key material changes |
| Password file | No | Protect according to the platform and security procedure |
| Oracle home and inventory | No | Protect or reconstruct through the software deployment process |
| Listener and naming configuration | No | Version and protect separately |
| External recovery catalog | No | Back up its database and protect its credentials |
| Data Pump dump files | No | Apply a separate encryption, retention, and test-import policy |
Transparent Data Encryption makes the keystore especially important. Encrypted data and encrypted backups may be unusable if the required keys are lost. Store keystore backups securely and separately from the encrypted database backup while ensuring that authorized recovery personnel can retrieve both during a disaster.
Start by reviewing the complete RMAN output and the repository summary:
RMAN> LIST BACKUP SUMMARY;
The summary identifies backup keys, types, completion times, devices, status, and tags. It reports repository metadata; it does not read every block in
every backup piece. Similarly, CROSSCHECK determines whether recorded backup files are accessible at their expected locations and synchronizes
repository status. It is not a content-validation command.
RMAN provides different checks for the live database and the stored restore inputs. To read the current database files and check physical and logical block structure without creating a backup, run:
RMAN> BACKUP VALIDATE CHECK LOGICAL DATABASE;
This command reads the source database. The word BACKUP in its syntax does not mean that it validates an existing backup set. Review its output
and, when appropriate, the V$DATABASE_BLOCK_CORRUPTION view.
To make RMAN select and read the backups it would use for a database restore without writing restored data files, run:
RMAN> RESTORE DATABASE VALIDATE;
Restore validation confirms that the selected backup sets or image copies are available, readable, and not corrupt. Run it through the intended disk, tape, cloud, or media-management path. It does not prove that every archived log needed for a particular recovery endpoint, TDE key, password, network route, credential, or external configuration file will be available during an emergency.
The strongest evidence is a controlled restore and recovery to an isolated destination. Test the recovery scenario that the production plan promises, not merely the easiest backup to access. Confirm the database identity, control-file and SPFILE recovery, data-file restore, archived-redo application, TDE keystore availability, service configuration, and the required database-open procedure.
Record the elapsed time and compare it with the RTO. Record the recovery endpoint and compare it with the RPO. Investigate missing files, expired credentials, media-manager delays, unusable keys, incorrect scripts, capacity problems, and manual steps. Feed those findings back into the schedule, retention, storage, documentation, and automation.
A completed RMAN job creates a candidate recovery asset. A successful validation increases confidence. A documented restore-and-recovery exercise demonstrates that the combined backup system can meet its intended objective.
The original Export lesson divided full-mode exports into complete, cumulative, and incremental operations. Do not carry that terminology into Data Pump. A current incremental strategy belongs to RMAN and works at the data-block level.
The baseline syntax is:
RMAN> BACKUP INCREMENTAL LEVEL 0 DATABASE;
A level 0 backup can parent later level 1 backups. A normal RMAN full backup cannot, even though the two can contain similar data-file content. Later lessons can develop level 1 differential or cumulative schedules, block change tracking, merge strategies, and retention. Those RMAN concepts replace the retired original Export mechanism rather than modernizing it.
Data Pump remains available alongside that strategy when a logical export solves a separate requirement. Keep the promises explicit: Import proves the logical dump workflow, while restore and recovery prove the RMAN workflow.