OraMatt: YABAOracle

Yet Another Blog About Oracle

Some 12c Multitenant commands

Here are some useful commands I use when working with the new 12c Multitenant option.

Open ALL Pluggable Databases (PDBs):
As sysdba

alter pluggable database all open;

Switch to a PDB:

ALTER SESSION SET CONTAINER = <PDB_name>;

Switch back the ROOT Container (CDB$ROOT):

ALTER SESSION SET CONTAINER = CDB$ROOT;

Connecting to a Specific PDB with a Specific Service Name:

sqlplus matt@'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=ZEUS)(SERVICE_NAME=matt_test)))'

or to a Active DataGuard Instance on the SAME server

sqlplus matt@'(DESCRIPTION=(ADDRESS=(PROTOCOL=tcp)(HOST=localhost)(PORT=1521))(CONNECT_DATA=(SID=SUEZ)(SERVICE_NAME=matt_test)))'

Leave a comment

Navigation

About

I’m Matt and I do Oracle things.