Skip to main content

Clone PDB to another CDB

Actually, we can clone a PDB from any PDB over the network, as long as they are connected and compatible.

Step 1. Create a database link to the source CDB.

SQL> create database link link_to_test1 connect to system identified by oracle using 'finanpdb';

Database link created.

Step 2: Clone the target PDB from the remote database via a database link.

SQL> create pluggable database finance_pdb from finanpdb@link_to_test1 file_name_convert=('/u01/app/oracle/oradata/orcl/FINANPDB','/u01/app/oracle/oradata/orcl/FINANCE_PDB');

Pluggable database created.

Parallel Creation

If you want to clone a big database, say 10 TB from the source, you can add some degrees of parallelism on it.

SQL> create pluggable database finance_pdb from finanpdb@link_to_test1 file_name_convert=('/u01/app/oracle/oradata/orcl/FINANPDB','/u01/app/oracle/oradata/orcl/FINANCE_PDB') parallel 8;

Pluggable database created.

Step 3: Open the target PDB to READ WRITE.

SQL> alter pluggable database finance_pdb open;

Pluggable database altered.

SQL> show pdbs;


Popular posts from this blog

Clone PDB in same container

We can clone a pluggable database from existing PDB ( PROD), residing on the same container. 1. First start the PDB in read only , which needs to be cloned. SQL> select name,open_mode from v$pdbs; NAME OPEN_MODE ------------------------------ ---------- PDB$SEED READ ONLY ORCL READ WRITE PROD READ WRITE SQL> alter session set container=PROD; Session altered. SQL> select file_name from dba_data_files; FILE_NAME -------------------------------------------------------------------------------- /home/oracle/app/oracle/oradata/cdb1/prod/system01.dbf /home/oracle/app/oracle/oradata/cdb1/prod/sysaux01.dbf SQL> show con_name CON_NAME ------------------------------ PROD SQL> shutdown immediate; Pluggable Database closed. SQL> startup open read only Pluggable Database opened. 2. Connect to the container and clone the pluggable: -- connect to container CDB1 SQL> conn sys/oracle@cdb1 as sysdba Connected. SQL> show con_name CON_NAME ------------------------------ CDB$ROOT --