Oracle12c Multitenant Architecture
Multitenant Container (CDB) and
Pluggable Databases (PDBs)
How plugging a Non-CDB into a CDB
Assuming that we have a non-CDB
database named “mydbs.” We want to move it to
mycdb and change it to a pluggable database. One way to do this, it is to use
the Export/Import DataPump tool. The other method is using the DBMS_PDB package. You need to execute this
package in the non-CDB mydbs to generate XML file to describe the metadata on
your non-CDB database. Then you use the XML file to create your pluggable
database (pdb_mydbs) in mycdb. At last, you
need to convert the plugged non-CDB to a pluggable database by running the noncdb_to_pdb.sql file. This sql file will
delete unnecessary metadata from PDB SYSTEM tablespace.
How to merge two CDBs
Let us assume that you have
another CDB named “old_mycdb” and you want to
merge all PDBs of old_mycdb into the created
Steps to merge:
How to drop a multitenant container CDB or a pluggable database PDB
You should login to the CDB,
shutdown the database then startup with the “mount restrict” option.
Assuming you want to drop the
OLD_MYPDB1 and OLD_MYPDB2 pluggable databases. First, you need to close the
databases and then drop them.
How to manage a Multitenant Container Database (CDB) and Pluggable
How to startup and shutdown a
Multitenant Container Database (CDB)
How to open and close
Pluggable Databases (PDBs)
Since you shutdown the
multitenant container, all the PDBs were closed. When you startup the CDB, all
the PDBs are going to be on the MOUNTED mode.
How to create
AFTER STARTUP trigger to open all PDBs except the mypdb2_clone
Create a trigger.
Get the list of all PDBs open
You can also change a
pluggable database to a restricted mode.
How to change instance parameters which may impact on PDBs
On the multitenant
architecture, you may change some parameters that will impact only pluggable
To change them, you need login
to the pluggable database using your net service name created in the
How to manage tablespaces in a CDB (Multitenant Container) and PDBs
Let us view permanent and
temporary tablespaces properties in mycdb using
the DATABASE_PROPERTIES view.
Change your default tablespace
from USERS to MYTBS.
Now, let us create a permanent
tablespace (mytbs4local) in one of your
pluggable database (mypdb1).
Create a temporary tablespace
(temp4mypdb1) in the
How to manage users in a CDB (Multitenant Container) and PDBs (Pluggable
There are two types of users:
common users and local users.
The common users will be
created in the root container and start with prefix of c## or C##. To create a
local use, you need to login to the pluggable database using net service name
and create user not start with c## or C## prefix.
Notice that you cannot create
a local user in the root container. A local user or role is not allowed in