How to Restore a Single PDB from a Full RMAN Backup in Oracle 19c (Step-by-Step)

Step-by-step guide to restore a single PDB from a full RMAN backup in Oracle Database with commands, examples, and best practices for DBAs.
Restoring a single Pluggable Database (PDB) from a full RMAN backup is a common requirement in Oracle multitenant environments. Instead of restoring the entire CDB, Oracle RMAN allows DBAs to recover only the required PDB, saving both time and storage. In this post, you’ll learn step-by-step how to restore and recover a single PDB from a full RMAN backup in Oracle 19c.


Source:
SQL> select name, open_mode, database_role, log_mode from v$database;

NAME      OPEN_MODE            DATABASE_ROLE    LOG_MODE
--------- -------------------- ---------------- ------------
ORCLCDB   READ WRITE           PRIMARY          ARCHIVELOG

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB                        READ WRITE NO
         4 TESTPDB                        READ WRITE NO
In this article, we will restore the container database and the required PDB (TESTPDB) while excluding the non-required PDB (ORCLPDB).

Step 1: Take a Full RMAN Backup and Transfer It to the Target Database (Including Parameter and Password Files)

Target:
[oracle@dba-simplified ~]$ cd /home/backup/
[oracle@dba-simplified backup]$ ls -ltr
total 1829324
-rw-r--r-- 1 oracle oinstall      1327 Dec 17 19:32 initorclcdb.ora
-rw-r----- 1 oracle oinstall  29758976 Dec 17 19:32 ORCLCDB_Arch_074bjggo_7_1_1.archbkp
-rw-r----- 1 oracle oinstall  18808832 Dec 17 19:32 ORCLCDB_control_02_ORCLCDB_17_12_2025_084bjggs_8_1_1.bkp
-rw-r----- 1 oracle oinstall  18808832 Dec 17 19:32 ORCLCDB_control_ORCLCDB_17_12_2025_014bjfti_1_1_1.bkp
-rw-r----- 1 oracle oinstall  18808832 Dec 17 19:32 ORCLCDB_control_ORCLCDB_17_12_2025_024bjgal_2_1_1.bkp
-rw-r----- 1 oracle oinstall 583786496 Dec 17 19:32 ORCLCDB_rman_ORCLCDB_17_12_2025_034bjgao_3_1_1.bkp
-rw-r----- 1 oracle oinstall 430252032 Dec 17 19:32 ORCLCDB_rman_ORCLCDB_17_12_2025_044bjgcp_4_1_1.bkp
-rw-r----- 1 oracle oinstall 345317376 Dec 17 19:33 ORCLCDB_rman_ORCLCDB_17_12_2025_054bjge7_5_1_1.bkp
-rw-r----- 1 oracle oinstall 427565056 Dec 17 19:33 ORCLCDB_rman_ORCLCDB_17_12_2025_064bjgfa_6_1_1.bkp
-rw-r----- 1 oracle oinstall    114688 Dec 17 19:33 ORCLCDB_spfile_094bjggu_9_1_1

Step 2: Create Necessary Directories

[oracle@dba-simplified ~]$ mkdir -p /home/app/oracle/admin/orclcdb/adump
[oracle@dba-simplified ~]$ mkdir -p /home/app/oracle/oradata/ORCLCDB/controlfile
[oracle@dba-simplified ~]$ mkdir -p /home/app/oracle/fast_recovery_area/ORCLCDB/controlfile
[oracle@dba-simplified ~]$ mkdir -p /home/app/oracle/fast_recovery_area/ORCLCDB/onlinelog
[oracle@dba-simplified ~]$ mkdir -p /home/app/oracle/ORCLCDB/archives
[oracle@dba-simplified ~]$ mkdir -p /data/ORCLCDB/datafile
[oracle@dba-simplified ~]$ mkdir -p /data/ORCLCDB/testpdb/datafile

Step 3: Configure Parameter file

[oracle@dba-simplified ~]$ cd $ORACLE_HOME/dbs
[oracle@dba-simplified dbs]$ cat initorclcdb.ora
orclcdb.__data_transfer_cache_size=0
orclcdb.__db_cache_size=536870912
orclcdb.__inmemory_ext_roarea=0
orclcdb.__inmemory_ext_rwarea=0
orclcdb.__java_pool_size=16777216
orclcdb.__large_pool_size=16777216
orclcdb.__oracle_base='/home/app/oracle'#ORACLE_BASE set from environment
orclcdb.__pga_aggregate_target=620756992
orclcdb.__sga_target=922746880
orclcdb.__shared_io_pool_size=50331648
orclcdb.__shared_pool_size=285212672
orclcdb.__streams_pool_size=0
orclcdb.__unified_pga_pool_size=0
*.audit_file_dest='/home/app/oracle/admin/orclcdb/adump'
*.audit_trail='db'
*.compatible='19.0.0'
*.control_files='/home/app/oracle/oradata/ORCLCDB/controlfile/o1_mf_nn5fpwj6_.ctl','/home/app/oracle/fast_recovery_area/ORCLCDB/controlfile/o1_mf_nn5fpwl5_.ctl'
*.db_block_size=8192
*.db_create_file_dest='/home/app/oracle/oradata'
*.db_name='orclcdb'
*.db_recovery_file_dest='/home/app/oracle/fast_recovery_area'
*.db_recovery_file_dest_size=12732m
*.diagnostic_dest='/home/app/oracle'
*.dispatchers='(PROTOCOL=TCP) (SERVICE=orclcdbXDB)'
*.enable_pluggable_database=true
*.local_listener='LISTENER_ORCLCDB'
*.log_archive_dest_1='LOCATION=/home/app/oracle/ORCLCDB/archives'
*.log_archive_format='ARC_%t_%s_%r.arc'
*.memory_target=1470m
*.open_cursors=300
*.processes=300
*.remote_login_passwordfile='EXCLUSIVE'
*.undo_tablespace='UNDOTBS1'

Step 4: Start the Database Instance in NOMOUNT Mode

[oracle@dba-simplified ~]$ . oraenv
ORACLE_SID = [orcl] ? orclcdb
ORACLE_HOME = [/home/oracle] ? /home/app/oracle/product/19.3.0/db_1
The Oracle base remains unchanged with value /home/app/oracle
[oracle@dba-simplified ~]$
[oracle@dba-simplified ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 17 19:50:06 2025
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup nomount;
ORACLE instance started.

Total System Global Area 1543502936 bytes
Fixed Size                  9178200 bytes
Variable Size             939524096 bytes
Database Buffers          587202560 bytes
Redo Buffers                7598080 bytes
SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0

Step 5: Restore the Control File and Mount the Database

[oracle@dba-simplified ~]$ rman target /

Recovery Manager: Release 19.0.0.0.0 - Production on Wed Dec 17 19:56:12 2025
Version 19.28.0.0.0

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

connected to target database: ORCLCDB (not mounted)

RMAN> restore controlfile from '/home/backup/ORCLCDB_control_02_ORCLCDB_17_12_2025_084bjggs_8_1_1.bkp';
restore controlfile from '/home/backup/ORCLCDB_control_02_ORCLCDB_17_12_2025_084bjggs_8_1_1.bkp';
Starting restore at 17-DEC-25
using target database control file instead of recovery catalog
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=237 device type=DISK

channel ORA_DISK_1: restoring control file
channel ORA_DISK_1: restore complete, elapsed time: 00:00:01
output file name=/home/app/oracle/oradata/ORCLCDB/controlfile/o1_mf_nn5fpwj6_.ctl
output file name=/home/app/oracle/fast_recovery_area/ORCLCDB/controlfile/o1_mf_nn5fpwl5_.ctl
Finished restore at 17-DEC-25


RMAN> alter database mount;
alter database mount;
released channel: ORA_DISK_1
Statement processed

Step 6: Catalog RMAN Backup Location and List Available Backups and Database Schema

RMAN> catalog start with '/home/backup';
catalog start with '/home/backup';
Starting implicit crosscheck backup at 17-DEC-25
allocated channel: ORA_DISK_1
channel ORA_DISK_1: SID=257 device type=DISK
Crosschecked 7 objects
Finished implicit crosscheck backup at 17-DEC-25

Starting implicit crosscheck copy at 17-DEC-25
using channel ORA_DISK_1
Finished implicit crosscheck copy at 17-DEC-25

searching for all files in the recovery area
cataloging files...
no files cataloged

searching for all files that match the pattern /home/backup

List of Files Unknown to the Database
=====================================
File Name: /home/backup/initorclcdb.ora
File Name: /home/backup/ORCLCDB_control_02_ORCLCDB_17_12_2025_084bjggs_8_1_1.bkp
File Name: /home/backup/ORCLCDB_spfile_094bjggu_9_1_1

Do you really want to catalog the above files (enter YES or NO)? yes
cataloging files...
cataloging done

List of Cataloged Files
=======================
File Name: /home/backup/ORCLCDB_control_02_ORCLCDB_17_12_2025_084bjggs_8_1_1.bkp
File Name: /home/backup/ORCLCDB_spfile_094bjggu_9_1_1

List of Files Which Were Not Cataloged
=======================================
File Name: /home/backup/initorclcdb.ora
  RMAN-07517: Reason: The file header is corrupted


RMAN> list backup by backup;
list backup by backup;

List of Backup Sets
===================


BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
1       Full    17.92M     DISK        00:00:01     17-DEC-25
        BP Key: 1   Status: AVAILABLE  Compressed: NO  Tag: TAG20251217T214626
        Piece Name: /home/backup/ORCLCDB_control_ORCLCDB_17_12_2025_014bjfti_1_1_1.bkp
  Control File Included: Ckp SCN: 2403807      Ckp time: 17-DEC-25

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
2       Full    17.92M     DISK        00:00:01     17-DEC-25
        BP Key: 2   Status: AVAILABLE  Compressed: NO  Tag: TAG20251217T215325
        Piece Name: /home/backup/ORCLCDB_control_ORCLCDB_17_12_2025_024bjgal_2_1_1.bkp
  Control File Included: Ckp SCN: 2405976      Ckp time: 17-DEC-25

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
3       Full    556.73M    DISK        00:00:55     17-DEC-25
        BP Key: 3   Status: AVAILABLE  Compressed: YES  Tag: TAG20251217T215328
        Piece Name: /home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_034bjgao_3_1_1.bkp
  List of Datafiles in backup set 3
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  1       Full 2405990    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_system_nn5fmfr8_.dbf
  3       Full 2405990    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_sysaux_nn5fnk1c_.dbf
  4       Full 2405990    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_undotbs1_nn5fo087_.dbf
  7       Full 2405990    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_users_nn5fo1dh_.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
4       Full    410.31M    DISK        00:00:41     17-DEC-25
        BP Key: 4   Status: AVAILABLE  Compressed: YES  Tag: TAG20251217T215328
        Piece Name: /home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_044bjgcp_4_1_1.bkp
  List of Datafiles in backup set 4
  Container ID: 4, PDB Name: TESTPDB
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  14      Full 2404073    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/testpdb/system.dbf
  15      Full 2404073    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/testpdb/sysaux.dbf
  16      Full 2404073    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/testpdb/undo.dbf
  17      Full 2404073    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/testpdb/users.dbf
  18      Full 2404073    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/testpdb/data01.dbf
  19      Full 2404073    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/testpdb/data02.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
5       Full    329.31M    DISK        00:00:34     17-DEC-25
        BP Key: 5   Status: AVAILABLE  Compressed: YES  Tag: TAG20251217T215328
        Piece Name: /home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_054bjge7_5_1_1.bkp
  List of Datafiles in backup set 5
  Container ID: 3, PDB Name: ORCLPDB
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  9       Full 2406049    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/pdb_datafile/system.dbf
  10      Full 2406049    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/pdb_datafile/sysaux.dbf
  11      Full 2406049    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/pdb_datafile/undo.dbf
  12      Full 2406049    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/pdb_datafile/users.dbf
  13      Full 2406049    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/pdb_datafile/data01.dbf

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
6       Full    407.75M    DISK        00:00:41     17-DEC-25
        BP Key: 6   Status: AVAILABLE  Compressed: YES  Tag: TAG20251217T215328
        Piece Name: /home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_064bjgfa_6_1_1.bkp
  List of Datafiles in backup set 6
  Container ID: 2, PDB Name: PDB$SEED
  File LV Type Ckp SCN    Ckp Time  Abs Fuz SCN Sparse Name
  ---- -- ---- ---------- --------- ----------- ------ ----
  5       Full 2389286    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_system_nn5hl571_.dbf
  6       Full 2389286    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_sysaux_nn5hl578_.dbf
  8       Full 2389286    17-DEC-25              NO    /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_undotbs1_nn5hl57d_.dbf

BS Key  Size       Device Type Elapsed Time Completion Time
------- ---------- ----------- ------------ ---------------
7       28.38M     DISK        00:00:02     17-DEC-25
        BP Key: 7   Status: AVAILABLE  Compressed: YES  Tag: TAG20251217T215640
        Piece Name: /home/backup/ORCLCDB_Arch_074bjggo_7_1_1.archbkp

  List of Archived Logs in backup set 7
  Thrd Seq     Low SCN    Low Time  Next SCN   Next Time
  ---- ------- ---------- --------- ---------- ---------
  1    15      2379274    17-DEC-25 2405929    17-DEC-25
  1    16      2405929    17-DEC-25 2406103    17-DEC-25

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
8       Full    17.92M     DISK        00:00:01     17-DEC-25
        BP Key: 8   Status: AVAILABLE  Compressed: NO  Tag: TAG20251217T215643
        Piece Name: /home/backup/ORCLCDB_control_02_ORCLCDB_17_12_2025_084bjggs_8_1_1.bkp
  Control File Included: Ckp SCN: 2406132      Ckp time: 17-DEC-25

BS Key  Type LV Size       Device Type Elapsed Time Completion Time
------- ---- -- ---------- ----------- ------------ ---------------
9       Full    96.00K     DISK        00:00:00     17-DEC-25
        BP Key: 9   Status: AVAILABLE  Compressed: NO  Tag: TAG20251217T215646
        Piece Name: /home/backup/ORCLCDB_spfile_094bjggu_9_1_1
  SPFILE Included: Modification time: 17-DEC-25
  SPFILE db_unique_name: ORCLCDB


RMAN> report schema;
report schema;
RMAN-06139: warning: control file is not current for REPORT SCHEMA
Report of database schema for database with db_unique_name ORCLCDB

List of Permanent Datafiles
===========================
File Size(MB) Tablespace           RB segs Datafile Name
---- -------- -------------------- ------- ------------------------
1    0        SYSTEM               ***     /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_system_nn5fmfr8_.dbf
3    0        SYSAUX               ***     /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_sysaux_nn5fnk1c_.dbf
4    0        UNDOTBS1             ***     /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_undotbs1_nn5fo087_.dbf
5    0        PDB$SEED:SYSTEM      ***     /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_system_nn5hl571_.dbf
6    0        PDB$SEED:SYSAUX      ***     /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_sysaux_nn5hl578_.dbf
7    0        USERS                ***     /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_users_nn5fo1dh_.dbf
8    0        PDB$SEED:UNDOTBS1    ***     /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_undotbs1_nn5hl57d_.dbf
9    0        ORCLPDB:SYSTEM       ***     /home/app/oracle/oradata/ORCLCDB/pdb_datafile/system.dbf
10   0        ORCLPDB:SYSAUX       ***     /home/app/oracle/oradata/ORCLCDB/pdb_datafile/sysaux.dbf
11   0        ORCLPDB:UNDOTBS1     ***     /home/app/oracle/oradata/ORCLCDB/pdb_datafile/undo.dbf
12   0        ORCLPDB:USERS        ***     /home/app/oracle/oradata/ORCLCDB/pdb_datafile/users.dbf
13   0        ORCLPDB:DATA1        ***     /home/app/oracle/oradata/ORCLCDB/pdb_datafile/data01.dbf
14   0        TESTPDB:SYSTEM       ***     /home/app/oracle/oradata/ORCLCDB/testpdb/system.dbf
15   0        TESTPDB:SYSAUX       ***     /home/app/oracle/oradata/ORCLCDB/testpdb/sysaux.dbf
16   0        TESTPDB:UNDOTBS1     ***     /home/app/oracle/oradata/ORCLCDB/testpdb/undo.dbf
17   0        TESTPDB:USERS        ***     /home/app/oracle/oradata/ORCLCDB/testpdb/users.dbf
18   0        TESTPDB:DATA01       ***     /home/app/oracle/oradata/ORCLCDB/testpdb/data01.dbf
19   0        TESTPDB:DATA02       ***     /home/app/oracle/oradata/ORCLCDB/testpdb/data02.dbf

List of Temporary Files
=======================
File Size(MB) Tablespace           Maxsize(MB) Tempfile Name
---- -------- -------------------- ----------- --------------------
1    20       TEMP                 32767       /home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_temp_nn5fq9gk_.tmp
2    36       PDB$SEED:TEMP        32767       /home/app/oracle/oradata/ORCLCDB/datafile/temp012025-12-17_19-59-43-296-PM.dbf
3    211      ORCLPDB:TEMP         32767       /home/app/oracle/oradata/ORCLCDB/462808A5CC144EFCE06312FA5DDA6426/datafile/o1_mf_temp_nn5k30s6_.dbf
4    211      TESTPDB:TEMP         32767       /home/app/oracle/oradata/ORCLCDB/4628E9FF58232227E06312FA5DDACA92/datafile/o1_mf_temp_nn5ns5rs_.dbf
Note: From the RMAN REPORT SCHEMA output, identify the datafiles required for the target container database and PDB, and note the tablespaces of other PDBs that will be skipped during recovery.

Step 7: Restore the Container Database and the Required Pluggable Database

RMAN> run
{
allocate channel C1 device type DISK;
allocate channel C2 device type DISK;
allocate channel C3 device type DISK;
set newname for datafile 1  to '/data/ORCLCDB/datafile/o1_mf_system_nn5fmfr8_.dbf';
set newname for datafile 3  to '/data/ORCLCDB/datafile/o1_mf_sysaux_nn5fnk1c_.dbf';
set newname for datafile 4  to '/data/ORCLCDB/datafile/o1_mf_undotbs1_nn5fo087_.dbf';
set newname for datafile 5  to '/data/ORCLCDB/datafile/o1_mf_system_nn5hl571_.dbf';
set newname for datafile 6  to '/data/ORCLCDB/datafile/o1_mf_sysaux_nn5hl578_.dbf';
set newname for datafile 7  to '/data/ORCLCDB/datafile/o1_mf_users_nn5fo1dh_.dbf';
set newname for datafile 8  to '/data/ORCLCDB/datafile/o1_mf_undotbs1_nn5hl57d_.dbf';
set newname for datafile 14  to '/data/ORCLCDB/testpdb/datafile/system.dbf';
set newname for datafile 15  to '/data/ORCLCDB/testpdb/datafile/sysaux.dbf';
set newname for datafile 16  to '/data/ORCLCDB/testpdb/datafile/undo.dbf';
set newname for datafile 17  to '/data/ORCLCDB/testpdb/datafile/users.dbf';
set newname for datafile 18  to '/data/ORCLCDB/testpdb/datafile/data01.dbf';
set newname for datafile 19  to '/data/ORCLCDB/testpdb/datafile/data02.dbf';
set newname for tempfile 1 to ' /data/ORCLCDB/datafile/o1_mf_temp_nn5fq9gk_.tmp';
set newname for tempfile 2 to ' /data/ORCLCDB/datafile/temp012025-12-17_19-59-43-296-PM.dbf';
set newname for tempfile 4 to ' /data/ORCLCDB/testpdb/datafile/o1_mf_temp_nn5ns5rs_.dbf';
restore database root;
restore database 'PDB$SEED';
restore database 'TESTPDB';
switch datafile all;
switch tempfile all;
release channel C1;
release channel C2;
release channel C3;
}run
2> {
3> allocate channel C1 device type DISK;
4> allocate channel C2 device type DISK;
5> allocate channel C3 device type DISK;
6> set newname for datafile 1  to '/data/ORCLCDB/datafile/o1_mf_system_nn5fmfr8_.dbf';
7> set newname for datafile 3  to '/data/ORCLCDB/datafile/o1_mf_sysaux_nn5fnk1c_.dbf';
8> set newname for datafile 4  to '/data/ORCLCDB/datafile/o1_mf_undotbs1_nn5fo087_.dbf';
9> set newname for datafile 5  to '/data/ORCLCDB/datafile/o1_mf_system_nn5hl571_.dbf';
10> set newname for datafile 6  to '/data/ORCLCDB/datafile/o1_mf_sysaux_nn5hl578_.dbf';
11> set newname for datafile 7  to '/data/ORCLCDB/datafile/o1_mf_users_nn5fo1dh_.dbf';
12> set newname for datafile 8  to '/data/ORCLCDB/datafile/o1_mf_undotbs1_nn5hl57d_.dbf';
13> set newname for datafile 14  to '/data/ORCLCDB/testpdb/datafile/system.dbf';
14> set newname for datafile 15  to '/data/ORCLCDB/testpdb/datafile/sysaux.dbf';
15> set newname for datafile 16  to '/data/ORCLCDB/testpdb/datafile/undo.dbf';
16> set newname for datafile 17  to '/data/ORCLCDB/testpdb/datafile/users.dbf';
17> set newname for datafile 18  to '/data/ORCLCDB/testpdb/datafile/data01.dbf';
18> set newname for datafile 19  to '/data/ORCLCDB/testpdb/datafile/data02.dbf';
19> set newname for tempfile 1 to ' /data/ORCLCDB/datafile/o1_mf_temp_nn5fq9gk_.tmp';
20> set newname for tempfile 2 to ' /data/ORCLCDB/datafile/temp012025-12-17_19-59-43-296-PM.dbf';
21> set newname for tempfile 4 to ' /data/ORCLCDB/testpdb/datafile/o1_mf_temp_nn5ns5rs_.dbf';
22> restore database root;
23> restore database 'PDB$SEED';
24> restore database 'TESTPDB';
25> switch datafile all;
26> switch tempfile all;
27> release channel C1;
28> release channel C2;
29> release channel C3;
30>
}
using target database control file instead of recovery catalog
allocated channel: C1
channel C1: SID=15 device type=DISK

allocated channel: C2
channel C2: SID=257 device type=DISK

allocated channel: C3
channel C3: SID=14 device type=DISK

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

executing command: SET NEWNAME

Starting restore at 17-DEC-25

channel C1: starting datafile backup set restore
channel C1: specifying datafile(s) to restore from backup set
channel C1: restoring datafile 00001 to /data/ORCLCDB/datafile/o1_mf_system_nn5fmfr8_.dbf
channel C1: restoring datafile 00003 to /data/ORCLCDB/datafile/o1_mf_sysaux_nn5fnk1c_.dbf
channel C1: restoring datafile 00004 to /data/ORCLCDB/datafile/o1_mf_undotbs1_nn5fo087_.dbf
channel C1: restoring datafile 00007 to /data/ORCLCDB/datafile/o1_mf_users_nn5fo1dh_.dbf
channel C1: reading from backup piece /home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_034bjgao_3_1_1.bkp
channel C1: piece handle=/home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_034bjgao_3_1_1.bkp tag=TAG20251217T215328
channel C1: restored backup piece 1
channel C1: restore complete, elapsed time: 00:01:05
Finished restore at 17-DEC-25

Starting restore at 17-DEC-25

channel C1: starting datafile backup set restore
channel C1: specifying datafile(s) to restore from backup set
channel C1: restoring datafile 00005 to /data/ORCLCDB/datafile/o1_mf_system_nn5hl571_.dbf
channel C1: restoring datafile 00006 to /data/ORCLCDB/datafile/o1_mf_sysaux_nn5hl578_.dbf
channel C1: restoring datafile 00008 to /data/ORCLCDB/datafile/o1_mf_undotbs1_nn5hl57d_.dbf
channel C1: reading from backup piece /home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_064bjgfa_6_1_1.bkp
channel C1: piece handle=/home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_064bjgfa_6_1_1.bkp tag=TAG20251217T215328
channel C1: restored backup piece 1
channel C1: restore complete, elapsed time: 00:00:55
Finished restore at 17-DEC-25

Starting restore at 17-DEC-25

channel C1: starting datafile backup set restore
channel C1: specifying datafile(s) to restore from backup set
channel C1: restoring datafile 00014 to /data/ORCLCDB/testpdb/datafile/system.dbf
channel C1: restoring datafile 00015 to /data/ORCLCDB/testpdb/datafile/sysaux.dbf
channel C1: restoring datafile 00016 to /data/ORCLCDB/testpdb/datafile/undo.dbf
channel C1: restoring datafile 00017 to /data/ORCLCDB/testpdb/datafile/users.dbf
channel C1: restoring datafile 00018 to /data/ORCLCDB/testpdb/datafile/data01.dbf
channel C1: restoring datafile 00019 to /data/ORCLCDB/testpdb/datafile/data02.dbf
channel C1: reading from backup piece /home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_044bjgcp_4_1_1.bkp
channel C1: piece handle=/home/backup/ORCLCDB_rman_ORCLCDB_17_12_2025_044bjgcp_4_1_1.bkp tag=TAG20251217T215328
channel C1: restored backup piece 1
channel C1: restore complete, elapsed time: 00:00:45
Finished restore at 17-DEC-25

datafile 1 switched to datafile copy
input datafile copy RECID=17 STAMP=1220128255 file name=/home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_system_nn5k81m5_.dbf
datafile 3 switched to datafile copy
input datafile copy RECID=18 STAMP=1220128256 file name=/home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_sysaux_nn5k81o2_.dbf
datafile 4 switched to datafile copy
input datafile copy RECID=19 STAMP=1220128256 file name=/home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_undotbs1_nn5k81ow_.dbf
datafile 7 switched to datafile copy
input datafile copy RECID=20 STAMP=1220128256 file name=/home/app/oracle/oradata/ORCLCDB/datafile/o1_mf_users_nn5k81p8_.dbf
datafile 5 switched to datafile copy
input datafile copy RECID=21 STAMP=1220128256 file name=/home/app/oracle/oradata/ORCLCDB/4627ACE0D8DE1E2AE06312FA5DDAE38B/datafile/o1_mf_system_nn5kb366_.dbf
datafile 6 switched to datafile copy
input datafile copy RECID=22 STAMP=1220128256 file name=/home/app/oracle/oradata/ORCLCDB/4627ACE0D8DE1E2AE06312FA5DDAE38B/datafile/o1_mf_sysaux_nn5kb37l_.dbf
datafile 8 switched to datafile copy
input datafile copy RECID=23 STAMP=1220128256 file name=/home/app/oracle/oradata/ORCLCDB/4627ACE0D8DE1E2AE06312FA5DDAE38B/datafile/o1_mf_undotbs1_nn5kb383_.dbf
datafile 14 switched to datafile copy
input datafile copy RECID=24 STAMP=1220128256 file name=/data/ORCLCDB/testpdb/datafile/system.dbf
datafile 15 switched to datafile copy
input datafile copy RECID=25 STAMP=1220128256 file name=/data/ORCLCDB/testpdb/datafile/sysaux.dbf
datafile 16 switched to datafile copy
input datafile copy RECID=26 STAMP=1220128256 file name=/data/ORCLCDB/testpdb/datafile/undo.dbf
datafile 17 switched to datafile copy
input datafile copy RECID=27 STAMP=1220128256 file name=/data/ORCLCDB/testpdb/datafile/users.dbf
datafile 18 switched to datafile copy
input datafile copy RECID=28 STAMP=1220128256 file name=/data/ORCLCDB/testpdb/datafile/data01.dbf
datafile 19 switched to datafile copy
input datafile copy RECID=29 STAMP=1220128256 file name=/data/ORCLCDB/testpdb/datafile/data02.dbf

renamed tempfile 1 to  /data/ORCLCDB/datafile/o1_mf_temp_nn5fq9gk_.tmp in control file
renamed tempfile 2 to  /data/ORCLCDB/datafile/temp012025-12-17_19-59-43-296-PM.dbf in control file
renamed tempfile 4 to  /data/ORCLCDB/testpdb/datafile/o1_mf_temp_nn5ns5rs_.dbf in control file

released channel: C1

released channel: C2

released channel: C3

Step 8: Recover the Container Database and Required PDB While Skipping Non-Required PDB Tablespaces

RMAN> run
{
allocate channel C1 device type DISK;
allocate channel C2 device type DISK;
allocate channel C3 device type DISK;
recover database skip forever tablespace ORCLPDB:SYSTEM, ORCLPDB:SYSAUX, ORCLPDB:UNDOTBS1, ORCLPDB:USERS, ORCLPDB:DATA1;
release channel C1;
release channel C2;
release channel C3;
}run
2> {
3> allocate channel C1 device type DISK;
4> allocate channel C2 device type DISK;
5> allocate channel C3 device type DISK;
6> recover database skip forever tablespace ORCLPDB:SYSTEM, ORCLPDB:SYSAUX, ORCLPDB:UNDOTBS1, ORCLPDB:USERS, ORCLPDB:DATA1;
7> release channel C1;
8> release channel C2;
9> release channel C3;
10>
}
allocated channel: C1
channel C1: SID=15 device type=DISK

allocated channel: C2
channel C2: SID=257 device type=DISK

allocated channel: C3
channel C3: SID=14 device type=DISK

Starting recover at 17-DEC-25

Executing: alter database datafile 9, 10, 11, 12, 13 offline drop
starting media recovery

channel C1: starting archived log restore to default destination
channel C1: restoring archived log
archived log thread=1 sequence=16
channel C1: reading from backup piece /home/backup/ORCLCDB_Arch_074bjggo_7_1_1.archbkp
channel C1: piece handle=/home/backup/ORCLCDB_Arch_074bjggo_7_1_1.archbkp tag=TAG20251217T215640
channel C1: restored backup piece 1
channel C1: restore complete, elapsed time: 00:00:01
archived log file name=/home/app/oracle/ORCLCDB/archives/ARC_1_16_1220124469.arc thread=1 sequence=16
unable to find archived log
archived log thread=1 sequence=17
RMAN Command Id : 2025-12-17T20:27:56
RMAN Command Id : 2025-12-17T20:27:56
RMAN Command Id : 2025-12-17T20:27:56
released channel: C1
released channel: C2
released channel: C3
RMAN-00571: ===========================================================
RMAN-00569: =============== ERROR MESSAGE STACK FOLLOWS ===============
RMAN-00571: ===========================================================
RMAN-03002: failure of recover command at 12/17/2025 20:38:24
RMAN-06054: media recovery requesting unknown archived log for thread 1 with sequence 17 and starting SCN of 2406103
RMAN Client Diagnostic Trace file : /home/app/oracle/diag/clients/user_oracle/RMAN_3771234215_110/trace/ora_rman_21518_0.trc
RMAN Server Diagnostic Trace file : /home/app/oracle/diag/rdbms/orclcdb/orclcdb/trace/orclcdb_ora_21532.trc

RMAN>

Step 9: Open the Database with RESETLOGS

[oracle@dba-simplified ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 17 20:49:57 2025
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0

SQL> set lines 200 pages 2000
SQL> select name, open_mode, database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ORCLCDB   MOUNTED              PRIMARY

SQL> alter database open resetlogs;

Database altered.

SQL> select name, open_mode, database_role from v$database;

NAME      OPEN_MODE            DATABASE_ROLE
--------- -------------------- ----------------
ORCLCDB   READ WRITE           PRIMARY

Step 10: Drop the Non-Required PDB Entries from the Container Database, Open the Required PDB, and Save Its State

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 ORCLPDB                        MOUNTED
         4 TESTPDB                        MOUNTED
SQL>
SQL> drop pluggable database ORCLPDB including datafiles;

Pluggable database dropped.

SQL> alter pluggable database TESTPDB open;

Pluggable database altered.

SQL> alter pluggable database TESTPDB save state;

Pluggable database altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 TESTPDB                        READ WRITE NO
SQL>

Step 11: Add CDB and PDB Entries in tnsnames.ora and Set the LOCAL_LISTENER Parameter

[oracle@dba-simplified admin]$ cat tnsnames.ora
LISTENER =
  (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.150)(PORT = 1521))

ORCL =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.150)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcl)
    )
  )

ORCLDR =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.160)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orcldr)
    )
  )

ORCLCDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.150)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = orclcdb)
    )
  )

TESTPDB =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.150)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = testpdb)
    )
  )
[oracle@dba-simplified ~]$ sqlplus / as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 17 21:58:21 2025
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.


Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 TESTPDB                        READ WRITE NO
SQL>
SQL> alter system set local_listener='(ADDRESS = (PROTOCOL = TCP)(HOST = 192.168.0.150)(PORT = 1521))';

System altered.

SQL> alter system register;

System altered.

SQL>
SQL> show parameter local

NAME                                 TYPE        VALUE
------------------------------------ ----------- ------------------------------
local_listener                       string      (ADDRESS = (PROTOCOL = TCP)(HO
                                                 ST = 192.168.0.150)(PORT = 152
                                                 1))
parallel_force_local                 boolean     FALSE
SQL>

Step 12: Verify Listener and TNS Configuration by Connecting to CDB and PDB Using SQL*Plus

[oracle@dba-simplified ~]$ sqlplus sys@orclcdb as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 17 21:54:56 2025
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         4 TESTPDB                        READ WRITE NO
SQL>
SQL> exit
Disconnected from Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0
[oracle@dba-simplified ~]$
[oracle@dba-simplified ~]$ sqlplus sys@testpdb as sysdba

SQL*Plus: Release 19.0.0.0.0 - Production on Wed Dec 17 21:54:34 2025
Version 19.28.0.0.0

Copyright (c) 1982, 2025, Oracle.  All rights reserved.

Enter password:

Connected to:
Oracle Database 19c Enterprise Edition Release 19.0.0.0.0 - Production
Version 19.28.0.0.0

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         4 TESTPDB                        READ WRITE NO
SQL>
[oracle@dba-simplified ~]$ lsnrctl status | grep orclcdb
  Instance "orclcdb", status READY, has 1 handler(s) for this service...
  Instance "orclcdb", status READY, has 1 handler(s) for this service...
Service "orclcdb" has 1 instance(s).
  Instance "orclcdb", status READY, has 1 handler(s) for this service...
Service "orclcdbXDB" has 1 instance(s).
  Instance "orclcdb", status READY, has 1 handler(s) for this service...
  Instance "orclcdb", status READY, has 1 handler(s) for this service...
[oracle@dba-simplified ~]$ lsnrctl status | grep testpdb
Service "testpdb" has 1 instance(s).
[oracle@dba-simplified ~]$
Conclusion: Restoring a single PDB from a full RMAN backup is an efficient way to recover only the required data without restoring the entire CDB. By cataloging the backups, identifying the required datafiles, skipping non-required PDBs, and completing RMAN restore and recovery, you can successfully bring the target PDB online in Oracle 19c. This approach saves time, storage, and recovery effort, making it ideal for Oracle multitenant environments.

Post a Comment

© Ayaan Israr - All rights reserved. Premium By Ayaan Israr