In the next 2-3 posts we are going to see all the methods used to create Pluggable Database

There are following methods available to create Pluggable Database :

  • Clone a regular PDB
  • Create remote pdb using dblink
  • Create a regular pdb to an application PDB
  • Unplug and Plug a non-CDB
  • Unplug and plug a regular PDB
  • Unplug and plug an application container

1. Clone a regular PDB :

We can simply clone a regular Pluggable Database to create a new pluggable database.

I have one PDB created named PDBB121 and I want to create new PDB which should be a clone of PDB121 database.

Step 1: Connect to the CDB database

[oracle@localhost ~]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Mon Jul 30 12:13:13 2018

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


Connected to:
Oracle Database 12c Enterprise Edition Release 12.1.0.2.0 - 64bit Production
With the Partitioning, OLAP, Advanced Analytics and Real Application Testing options

SQL> select name,open_mode from v$database;

NAME	  OPEN_MODE
--------- --------------------
CDB121	  READ WRITE

Step 2: Check database which you want to create exist

SQL> show pdbs

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

Step 3: Clone database using create the pluggable database

SQL>  CREATE PLUGGABLE DATABASE CLONEPDB FROM PDB121 FILE_NAME_CONVERT=('/u02/oradata/cdb121/pdb121',
'/u02/oradata/cdb121/clonepdb');

Pluggable database created.

As I don’t have OMF enabled I need to pass the FILE_NAME_CONVERT parameter.

2.Create remote pdb using dblink

Create Pluggable Database using dblink

3. Clone a regular pdb to an application PDB :

Convert Regular PDB to Application PDB

4.Unplug and Plug a non-CDB

Plugging Non-CDB to CDB

5.Unplug and plug a regular PDB

Step 1: Connect to CDB :

Step 2: shutdown pluggable database which you want to unplug and plug to another cdb.

SQL>alter pluggable database pdb1 close immediate;

Step 3: Unplug database using the following statement

SQL>  alter pluggable database pdb1 unplug into '/u02/pdb1.xml';

Pluggable database altered.

Step 4: Connect to Container database where you want to plug the pdb1 database.

Step 5: Create a pluggable database using the .xml file

SQL> create pluggable database app_pdb  using '/u02/pdb1.xml';

Pluggable database created.

6.Unplug and plug an application container

Unplug and plug application container

If you want to be updated with all our articles send us an Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.