← PDB & Multitenant
Oracle · PDB & Multitenant
How to clone a PDB in Oracle Multitenant
Create a new PDB as a local clone of an existing one with CREATE PLUGGABLE DATABASE ... FROM, then open it.
Tested on12c18c19c21c23ai26ai
Create a new PDB as a clone of an existing one (a local clone within the same CDB). Run from the root.
Cloning copies the source datafiles and can use significant space and time. On 12.2 and later the source can stay READ WRITE (hot clone); otherwise open it READ ONLY first.
-- For a cold clone, open the source read only first:
-- ALTER PLUGGABLE DATABASE &&source_pdb CLOSE IMMEDIATE;
-- ALTER PLUGGABLE DATABASE &source_pdb OPEN READ ONLY;
CREATE PLUGGABLE DATABASE &&new_pdb FROM &&source_pdb
FILE_NAME_CONVERT = ('/u01/app/oracle/oradata/CDB/&source_pdb/',
'/u01/app/oracle/oradata/CDB/&new_pdb/');
ALTER PLUGGABLE DATABASE &new_pdb OPEN READ WRITE;
-- Verify (read-only)
SELECT name, open_mode FROM v$pdbs WHERE name = UPPER('&new_pdb');PDBMultitenantClone