Below are steps for converting a non CDB/PDB database to PDB database in oracle. i.e Plugging a normal 12c non pdb database to a container database.

 

READ more about CDB and PDB: Oracle 12c Multitenent architecture 

DEMO:

NON-CDB DB -NAME -> NONCDB
CDB DB NAME -> DBATEST

Prerequisites:

 Make sure One container database already exists. 

Check out How to create container database

STEPS:

1. Open the non-cdb database in read only mode:

2. Check the compatibility of PDB on ( NONCDB)

3. shutdown the NON-CDB database ( NONCDB)

 

Now connect to the container database, where it need to be plugged.

5. Check the violations:

 

6. Create pluggable database ( DBATEST)

7 . Run the noncdb_to_pdb.sql script

8. Open the PDB: