News
Perth, Australia
+ (61) 417713124
prosolutions@gavinsoorma.com

DBCA New Features Oracle 19c

  • Posted by Gavin Soorma
  • On June 24, 2019
  • 1 Comments
  • 18c, 19c, 19c new feature, CDB, clone, dbca, PDB, silent

In Oracle 19c a number of new features have been added to DBCA in silent mode.

In Oracle 18c, we could clone a PDB both via the GUI DBCA as well as using the dbca -silent -createPluggableDatabase command.

New in Oracle 19c is the ability to create a remote clone of a PDB as well as perform the relocate of a PDB using the DBCA silent mode.

We can use the createFromRemotePDB parameter of the DBCA command createPluggableDatabase to create a PDB by cloning a remote PDB as well as use the relocatePDB option to relocate a PDB from one container database to another.

Let us have a look at a worked example.

Here is the 19c environment:

a) host01: CDB1 (PDB1,PDB2)
b) host02: CDB2 (PDB2)

We will remote clone PDB1 from CDB1 and create the pluggable database in the container database CDB2.

We will then create another pluggable database PDB3 in CDB1 by cloning PDB1 using the dbca silent method.

Then we will relocate PDB3 from CDB1 to CDB2.

For this we need to create a common user in CDB1 and use this use to create a database link from CDB2 to CDB1.
 

***Create common user in CDB1***

SQL> create user c##link_user identified by oracle container=all;

User created.

SQL> grant sysoper,sysdba to c##link_user container=all;

Grant succeeded.

SQL> grant create pluggable database to c##link_user container=all;

Grant succeeded.

SQL> grant create session to c##link_user container=all;

Grant succeeded.


***Add TNS entry to connect to CDB1 from CDB2***

CDB1 =
  (DESCRIPTION =
    (ADDRESS = (PROTOCOL = TCP)(HOST = host02.localdomain)(PORT = 1521))
    (CONNECT_DATA =
      (SERVER = DEDICATED)
      (SERVICE_NAME = cdb1.localdomain)
    )
  )

***Create database link from CDB2 to CDB1***

SQL> create database link cdb1_link connect to c##link_user identified by oracle
    using 'cdb1';

Database link created.


SQL>  select * from dual@cdb1_link;

D
-
X


***Note the PDB's currently in CDB2***

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 PDB2 			  READ WRITE NO

 

Remote Pluggable Clone

 
Create the Pluggable Database using the dbca -silent -createPluggableDatabase command with the -createFromRemotePDB clause.
 

[oracle@host02 ~]$ dbca -silent -createPluggableDatabase -pdbname pdb1 -sourceDB cdb2 -createFromRemotePDB -remotePDBName pdb1 -dbLinkUsername c##link_user -remoteDBConnString "host01:1521/cdb1.localdomain" -remoteDBSYSDBAUserName SYS -dbLinkUserPassword oracle -remoteDBSYSDBAUserPassword welcome1 -sysDBAUserName SYS -sysDBAPassword welcome1 -pdbDatafileDestination '/u01/app/oracle/oradata/CDB2/pdb1/' 

Prepare for db operation
50% complete
Create pluggable database using remote clone operation
100% complete
Pluggable database "pdb1" plugged successfully.
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb2/pdb1/cdb2.log" for further details.


SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 PDB2 			  READ WRITE NO
	 4 PDB1 			  READ WRITE NO

 

Relocate Pluggable Database

 

First we create PDB3 in CDB1 by cloning from PDB1 using the dbca -silent -createPluggableDatabase command.
 

[oracle@host01 ~]$ dbca -silent -createPluggableDatabase -sourceDB cdb1 -pdbName pdb3 -createAsClone FALSE -createPDBFrom PDB -sourcePDB pdb1 -fileNameConvert '/u01/app/oracle/oradata/CDB1/pdb1/','/u01/app/oracle/oradata/CDB1/pdb3/'
Prepare for db operation
13% complete
Creating Pluggable Database
15% complete
19% complete
23% complete
31% complete
53% complete
Completing Pluggable Database Creation
60% complete
Executing Post Configuration Actions
100% complete
Pluggable database "pdb3" plugged successfully.
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb1/pdb3/cdb1.log" for further details.

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 PDB1 			  READ WRITE NO
	 4 PDB2 			  READ WRITE NO
 	 5 PDB3				  READ WRITE NO

 
Relocate PDB3 from CDB1 to CDB2 using the dbca -silent -relocatePDB command.
 

[oracle@host02 ~]$ dbca -silent  -relocatePDB -pdbname pdb3 -sourceDB cdb2 -remotePDBName pdb3 -dbLinkUsername c##link_user -remoteDBConnString "host02:1521/cdb1.localdomain" -remoteDBSYSDBAUserName SYS -dbLinkUserPassword oracle -remoteDBSYSDBAUserPassword G#vin2407 -sysDBAUserName SYS -sysDBAPassword G#vin2407 -pdbDatafileDestination '/u01/app/oracle/oradata/CDB2/pdb3/' 
Prepare for db operation
50% complete
Create pluggable database using relocate PDB operation
100% complete
Pluggable database "pdb3" plugged successfully.
Look at the log file "/u01/app/oracle/cfgtoollogs/dbca/cdb2/pdb3/cdb2.log" for further details.


****Note the PDB's now in CDB2****

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 PDB2 			  READ WRITE NO
	 4 PDB1 			  READ WRITE NO
	 5 PDB3 			  READ WRITE NO

****Note the PDB's now in CDB1****

SQL> show pdbs

    CON_ID CON_NAME			  OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
	 2 PDB$SEED			  READ ONLY  NO
	 3 PDB1 			  READ WRITE NO
	 4 PDB2 			  READ WRITE NO

 

1 Comments

Venky
  • Jun 25 2019
Awesome !!!

Leave Reply

Your email address will not be published. Required fields are marked *