Oracle 12c Create a Pluggable Container DB From Seed & Changing Containers

# Creating a pluggable container from the seed container pdb$seed
# First create a data sub-directory under the root container cdb$root data directory as follows (your path may vary to your oradata dir):
# while logged in as the oracle / Linux user that admins the 12c database

cd /u01/app/oracle/product/12.1.0.2/oradata/orcl
mkdir pdbmf11g
cd pdbmf11g

# BTW – I named this PDBMF11G because this was an 11g database, that I am migrating some of the schemas into a PDB (another post or two)

pwd
/u01/app/oracle/oradata/orcl/pdbmf11g

# then connected to cdb$root as sys or with dba privs execute the following create pluggable using the seed pdb$seed:

create pluggable database pdbmf11g
admin user mf11g identified by password
file_name_convert=(‘/u01/app/oracle/oradata/orcl/pdbseed’,
‘/u01/app/oracle/oradata/orcl/pdbmf11g’);

# make all the pluggable databases open when the root does – works on the next shutdown / startup cycle

CREATE or REPLACE trigger OPEN_ALL_PLUGGABLES
after startup
on database
BEGIN
execute immediate ‘alter pluggable database all open’;
END open_all_pdbs;

# Changing containers

alter session set container=pdbmf11g;
show con_name
con_name PDBMF11G
select * from v$containers;

sqlDevelTable

alter session set container=cdb$root;
show con_name
con_name CDB$ROOT

Hope this helps, Mike

Leave a Comment

Scroll to Top