1. Introduction
Oracle Multitenant architecture allows a Container Database (CDB) to host multiple Pluggable Databases (PDBs). In real-world production environments, failures often impact only a single PDB rather than the entire CDB.
This document explains how to restore and recover a single PDB from a full CDB RMAN backup in Oracle Database 19c, covering both storage scenarios:
• Restore on NFS (File System)
• Restore on ASM (Automatic Storage Management)
The same RMAN backup is reused; only the storage configuration differs.
2. Objective
• Take a full RMAN backup of the CDB
• Restore only one PDB (TESTPDB) from that backup
• Perform restore on:
o NFS-based storage
o ASM-based storage
• Avoid restoring the complete CDB
• Validate successful recovery
3. Environment Overview
Scenario 1: Source on NFS → Target on NFS
Source Environment (NFS-Based)
• Database Type: Container Database (CDB)
• Source CDB Name: ORCL
• Oracle Version: Oracle Database 19c (19.3)
• Storage Type: NFS / File System
• Database Mode: ARCHIVELOG
• Backup Tool: RMAN
Pluggable Databases in Source CDB
• ORCLPDB
• QAPDB
• FINPDB
• SECPDB
• TESTPDB
Backup Details
• Backup Type: Full CDB RMAN Backup
• Backup Includes:
o CDB root datafiles
o All PDB datafiles
o Archived redo logs
o Control file
o SPFILE
Target Environment (NFS-Based)
• Target Host: Separate server
• Target CDB Name: ORCL
• Oracle Version: 19.3
• Storage Type: NFS / File System
• Datafile Location: /u02/oradata/ORCL
• FRA Location: /u02/fra/ORCL
• Restore Scope: Only TESTPDB
Goal (Scenario 1)
To restore only TESTPDB on a target NFS-based CDB, using a full RMAN backup taken from a source NFS-based CDB (ORCL), without restoring other PDBs or the entire CDB.
Scenario 2: Source on ASM → Target on ASM
Source Environment (ASM-Based)
• Database Type: Container Database (CDB)
• Source CDB Name: PROD
• Oracle Version: Oracle Database 19c (19.3)
• Storage Type: ASM
• ASM Disk Groups:
o +DATA → Datafiles
o +RECO → Archivelogs and FRA
• Database Mode: ARCHIVELOG
• Backup Tool: RMAN
Pluggable Databases in Source CDB
• PRODPDB
• APPPDB
• DEVPDB
• TESTPDB
Backup Details
• Backup Type: Full CDB RMAN Backup
• Backup Includes:
o CDB root datafiles
o All PDB datafiles
o Archived redo logs
o Control file
o SPFILE
Target Environment (ASM-Based)
• Target Host: Separate server
• Target CDB Name: PROD
(Kept same as source for clarity; can be renamed if required)
• Oracle Version: 19.3
• Storage Type: ASM
• ASM Disk Groups:
o +DATA → Datafiles
o +RECO → FRA and Archivelogs
• Restore Scope: Only TESTPDB
Goal (Scenario 2)
To restore only TESTPDB on a target ASM-based CDB, using a full RMAN backup taken from an ASM-based source CDB (PROD), without restoring or impacting other PDBs.
4. Prerequisites
• Compatible Oracle versions on source and target
• Full RMAN backup available:
o Database
o Archivelogs
o Controlfile
o SPFILE
• Password file copied to target
• PFILE available
• Adequate storage space
• Correct ORACLE_HOME and ORACLE_SID
• Backup pieces copied to target server
5. High-Level Architecture Flow
1. Validate source database status
2. Take full RMAN backup of CDB
3. Copy backup pieces and configuration files to target
4. Prepare target environment
5. Restore control file and mount database
6. Catalog backups
7. Restore and recover only TESTPDB
8. Open restored PDB and validate
6. Implementation – Restore on NFS (File System)
6.1: Source Database Prechecks and Full Backup
This section describes the source-side validation and backup preparation before restoring a single PDB (TESTPDB) on the target system.
6.1.1 Source Database Basic Information
6.1.2 Verify Archive Log Configuration
6.1.3 Verify Container and PDB Information
6.1.4 Verify Datafile Locations & ControlFile Locations (NFS)
6.1.5 Capture DBID (Mandatory for Recovery Safety)
6.1.6 RMAN Backup Directory Verification
6.1.7 Full CDB RMAN Backup (NFS)
A full CDB backup is taken, including:
• All CDB and PDB datafiles
• Archived redo logs
• Control file
• SPFILE
6.2 Copy Backup and Configuration from Source to Target
This step covers copying RMAN backup pieces and database configuration files from the source host (srv5) to the target host (srv7).
6.2.1 Target Directory Structure Creation (srv7)
On the target host (srv7), create the directory structure.
The layout mirrors the source NFS structure for consistency.
6.2.2 Copy RMAN Backup Pieces from Source (srv5)
Navigate to the RMAN backup directory on the source host.
6.2.3 Copy Password File (SYSDBA Authentication)
6.2.4 Create and Copy PFILE (Optional but Recommended)
6.3 Target Host OS and Environment Preparation
6.3.1 Verify Backup Transfer on Target (srv7)
6.3.2 Verify Configuration Files on Target
6.3.3 Set Oracle Environment on Target
6.4 Create Minimal Initialization File on Target
A minimal init.ora is required to start the instance in NOMOUNT mode.
6.5 Start Instance in NOMOUNT and Restore Control File (NFS)
This step initializes the target database instance in NOMOUNT mode and restores the control file from the RMAN backup copied from the source system.
6.5.1 Start Instance in NOMOUNT Mode
Connect to SQL*Plus on the target server (srv7) as SYSDBA.
6.5.2 Connect to RMAN on Target
6.6 Catalog RMAN Backups and Inspect Backup Metadata
After mounting the database, the copied RMAN backup pieces must be cataloged so that RMAN can recognize and use them.
6.6.1 Catalog Backup Pieces
6.6.2 Inspect Database Schema from Control File
6.7 Restore the Database (ROOT + PDB$SEED + TESTPDB)
Since the target file paths are identical to source, there is no need to set NEWNAME. The full database (ROOT, PDB$SEED, TESTPDB, and other PDBs) is restored.
6.8 Recover Database While Skipping Unwanted PDBs
Since we only want TESTPDB to be recovered, other PDBs are permanently skipped in the recovery process.
This tells RMAN:
• Recover ROOT + PDB$SEED + TESTPDB
• Permanently mark the other PDBs as unrecoverable
Perfect for TESTPDB-only restore.
6.9 Open the CDB and Reset Logs
After recovery, open the CDB with RESETLOGS to complete the recovery process.
6.9.1 Verify PDBs
6.9.2 — Drop Unwanted Pluggable Databases
(ORCLPDB, QAPDB, FINPDB, SECPDB)
6.9.3 Verify Remaining PDBs
6.9.4 Save TESTPDB Open State
6.9.5 Validate TESTPDB
✔ TESTPDB data
✔ Object counts match expected values
✔ Database is production-ready
Note: Compare these values with pre-recovery source counts if prechecks were captured.
7. Implementation – Restore on ASM
ASM Disk Groups Used
• +DATA → Datafiles
• +RECO → Archivelogs and FRA
7.1: Source Database Prechecks and Full Backup
This section describes the source-side validation and backup preparation before restoring a single PDB (TESTPDB) on the target system.
7.1.1 Source Database Basic Information
7.1.2 Verify Archive Log Configuration
7.1.3 Verify Container and PDB Information
7.1.4 Verify Datafile Locations & ControlFile Locations (NFS)
7.1.5 RMAN Backup Directory Verification
Full backup to filesystem (not ASM), Pick a backup directory, e.g. : /backup/PROD
7.1.6 Full CDB RMAN Backup (ASM)
A full CDB backup is taken, including:
• All CDB and PDB datafiles
• Archived redo logs
• Control file
• SPFILE
7.2 Copy Backup and Configuration from Source to Target
This step covers copying RMAN backup pieces and database configuration files from the source host (srv5) to the target host (srv7).
7.2.1 Target Directory Structure Creation (srv7)
On the target host (srv7), create the directory structure.
The layout mirrors the source ASM structure for consistency.
7.2.2 Copy RMAN Backup Pieces from Source (srv5)
Navigate to the RMAN backup directory on the source host.
7.2.3 Copy Password File (SYSDBA Authentication)
7.2.4 Create and Copy PFILE (Optional but Recommended)
7.3 Target Host OS and Environment Preparation
7.3.1 Set Oracle Environment on Target
7.3.2 Create Minimal Initialization File on Target
A minimal init.ora is required to start the instance in NOMOUNT mode.
7.4 Start Instance in NOMOUNT and Restore Control File
This step initializes the target database instance in NOMOUNT mode and restores the control file from the RMAN backup copied from the source system.
7.4.1 Start Instance in NOMOUNT Mode
Connect to SQL*Plus on the target server (srv7) as SYSDBA.
7.4.2 Connect to RMAN on Target
7.5 Catalog RMAN Backups and Inspect Backup Metadata
After mounting the database, the copied RMAN backup pieces must be cataloged so that RMAN can recognize and use them.
7.5.1 Catalog Backup Pieces
7.5.2 Inspect Database Schema from Control File
7.6 Restore the Database (ROOT + PDB$SEED + TESTPDB)
Since the target file paths are identical to source, there is no need to set NEWNAME. The full database (ROOT, PDB$SEED, TESTPDB, and other PDBs) is restored.
7.7 Recover Database While Skipping Unwanted PDBs
Since we only want TESTPDB to be recovered, other PDBs are permanently skipped in the recovery process.
This tells RMAN:
• Recover ROOT + PDB$SEED + TESTPDB
• Permanently mark the other PDBs as unrecoverable
Perfect for TESTPDB-only restore.
7.8 Open the CDB and Reset Logs
After recovery, open the CDB with RESETLOGS to complete the recovery process.
7.8.1 Verify PDBs
7.8.2 — Drop Unwanted Pluggable Databases
(PRODPDB, APPDB, DEVPDB)
7.8.3 Verify Remaining PDBs
7.8.4 Save TESTPDB Open State
7.8.5 Validate TESTPDB
Note: Compare these values with pre-recovery source counts if prechecks were captured.
8. Key Differences: NFS vs ASM
Aspect NFS ASM
File Management Manual paths Oracle managed
Performance Moderate High
Scalability Limited Highly scalable
Production Usage Small/Medium Enterprise
9. Conclusion
This document demonstrates a real production-level Oracle DBA recovery scenario, where a single PDB is restored from a full CDB RMAN backup on both:
• NFS-based storage
• ASM-based storage
Using the same backup strategy, Oracle RMAN provides flexibility, reliability, and granular recovery, making it ideal for multitenant environments.
This approach is widely used for:
• PDB-level corruption recovery
• User error rollback
• Test and migration activities
• Disaster recovery scenarios
No comments:
Post a Comment