Forum Stats

  • 3,826,774 Users
  • 2,260,707 Discussions
  • 7,897,072 Comments

Discussions

Clone PDB from RMAN backup

Peasant81
Peasant81 Member Posts: 16 Green Ribbon
edited May 23, 2022 6:41PM in General Database Discussions

DB version:19c 

OS : RHEL 7.9 


I have my production pluggable DBs PDB1_P, PDB2_P, PDB3_P running in CDB_01P container DB in the production server.

and 

I have my UAT clones of above PDBs: PDB1_U, PDB2_U, PDB3_U running in CDB_01U container DB in the UAT DB server


Once a month, I want to refresh my UAT PDBs (PDB1_U, PDB2_U, PDB3_U) from PDB1_P, PDB2_P, PDB3_P using RMAN tape backup.


RMAN DUPLICATE is a possible solution. But, this involves 


Step1. Dropping the target UAT DBs, 


Step2. Then, in the UAT DB server, run the below RMAN DUPLICATE to an auxiliary DB (say CDB_01X ) .


set UNTIL TIME "TO_DATE('23-MAY-2022 13:45:00', 'DD-MON-YYYY HH24:MI:SS')";
DUPLICATE DATABASE CDB_01P dbid 8386008743 TO CDB_01X pluggable database PDB1_U, PDB2_U, PDB3_U, root
nofilenamecheck ;


Step3. Unplug the PDBs from the auxiliary DB CDB_01X and plugging it to CDB_01U container DB.


Step4. At the ASM layer, I need to move datafiles from CDB_01X subfolder to CDB_01U.


Is there an alternative to the above approach ?


Unfortunately, creating the UAT PDBs via DB Link pointed to production DB (using the below command) is not an option for me as source DBs are very busy 24x7 OLTP DBs and the below approach can hamper production DB's performance.


CREATE PLUGGABLE DATABASE PDB1_U FROM [email protected]_LINK_POINTING_TO_PROD;