Switch CDB (container) to PDB (pluggable) database in multitenant
[oracle@node2 ~]$ srvctl status database -d orcl
Instance orcl1 is running on node node1
Instance orcl2 is running on node node2
[oracle@node2 ~]$
[oracle@node2 ~]$
[oracle@node2 ~]$
[oracle@node2 ~]$ sqlplus "/as sysdba"
SQL*Plus: Release 12.1.0.2.0 Production on Thu Dec 10 19:56:50 2020
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, Real Application Clusters, Automatic Storage Management, OLAP,
Advanced Analytics and Real Application Testing options
SQL>
SQL>
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBORCL MOUNTED
SQL>
SQL>
SQL> alter pluggable database PDBORCL open read write;
Pluggable database altered.
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBORCL READ WRITE NO
SQL>
SQL> select INSTANCE_NUMBER,INSTANCE_NAME,HOST_NAME,VERSION,STARTUP_TIME,STATUS,EDITION from gv$instance;
INSTANCE_NUMBER INSTANCE_NAME HOST_NAME VERSION STARTUP_T STATUS EDITION
--------------- ---------------- ---------------------------------------------------------------- ----------------- --------- ------------ -------
2 orcl2 node2.localdomain 12.1.0.2.0 10-DEC-20 OPEN EE
1 orcl1 node1.localdomain 12.1.0.2.0 10-DEC-20 OPEN EE
SQL> show pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDBORCL READ WRITE NO
SQL>
SQL> show con_name
CON_NAME
------------------------------
CDB$ROOT
SQL>
SQL>
SQL> show con_id
CON_ID
------------------------------
1
SQL>
SQL> alter session set container=PDBORCL;
Session altered.
SQL> show con_name
CON_NAME
------------------------------
PDBORCL
SQL> show con_id
CON_ID
------------------------------
3
SQL>
SQL>