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>
==================
[oracle@node1 trace]$ crsctl stat res -t
--------------------------------------------------------------------------------
Name Target State Server State details
--------------------------------------------------------------------------------
Local Resources
--------------------------------------------------------------------------------
ora.DATA1.dg
ONLINE ONLINE node1 STABLE
ONLINE ONLINE node2 STABLE
ora.LISTENER.lsnr
ONLINE ONLINE node1 STABLE
ONLINE ONLINE node2 STABLE
ora.asm
ONLINE ONLINE node1 Started,STABLE
ONLINE ONLINE node2 Started,STABLE
ora.net1.network
ONLINE ONLINE node1 STABLE
ONLINE ONLINE node2 STABLE
ora.ons
ONLINE ONLINE node1 STABLE
ONLINE ONLINE node2 STABLE
--------------------------------------------------------------------------------
Cluster Resources
--------------------------------------------------------------------------------
ora.LISTENER_SCAN1.lsnr
1 ONLINE ONLINE node2 STABLE
ora.LISTENER_SCAN2.lsnr
1 ONLINE ONLINE node1 STABLE
ora.LISTENER_SCAN3.lsnr
1 ONLINE ONLINE node1 STABLE
ora.MGMTLSNR
1 ONLINE ONLINE node1 169.254.18.158,STABL
E
ora.cvu
1 ONLINE ONLINE node1 STABLE
ora.mgmtdb
1 ONLINE ONLINE node1 Open,STABLE
ora.node1.vip
1 ONLINE ONLINE node1 STABLE
ora.node2.vip
1 ONLINE ONLINE node2 STABLE
ora.oc4j
1 ONLINE UNKNOWN node1 CHECK TIMED OUT,STAB
LE
ora.orcl.db
1 ONLINE ONLINE node1 Open,STABLE
2 ONLINE ONLINE node2 Open,STABLE
ora.scan1.vip
1 ONLINE ONLINE node2 STABLE
ora.scan2.vip
1 ONLINE ONLINE node1 STABLE
ora.scan3.vip
1 ONLINE ONLINE node1 STABLE
--------------------------------------------------------------------------------
[oracle@node1 trace]$