日常工作需要记住这两个视图,检查pdb状态

$sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Sat Jan 20 17:52:42 2018

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, OLAP, Advanced Analytics and Real Application Testing options

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> desc cdb_pdbs;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 PDB_ID                                    NOT NULL NUMBER
 PDB_NAME                                  NOT NULL VARCHAR2(128)
 DBID                                      NOT NULL NUMBER
 CON_UID                                   NOT NULL NUMBER
 GUID                                               RAW(16)
 STATUS                                             VARCHAR2(9)
 CREATION_SCN                                       NUMBER
 VSN                                                NUMBER
 LOGGING                                            VARCHAR2(9)
 FORCE_LOGGING                                      VARCHAR2(3)
 FORCE_NOLOGGING                                    VARCHAR2(3)
 CON_ID                                    NOT NULL NUMBER

SQL> col pdb_name for a30
SQL> select pdb_id,pdb_name,status from cdb_pdbs;

    PDB_ID PDB_NAME                       STATUS
---------- ------------------------------ ------------------
         2 PDB$SEED                       NORMAL
         3 PDB1                           NORMAL
         4 PDB2                           NORMAL
         5 PDB3                           NORMAL
         6 PDB4                           NORMAL

SQL> desc v$pdbs;
 Name                                      Null?    Type
 ----------------------------------------- -------- ----------------------------
 CON_ID                                             NUMBER
 DBID                                               NUMBER
 CON_UID                                            NUMBER
 GUID                                               RAW(16)
 NAME                                               VARCHAR2(30)
 OPEN_MODE                                          VARCHAR2(10)
 RESTRICTED                                         VARCHAR2(3)
 OPEN_TIME                                          TIMESTAMP(3) WITH TIME ZONE
 CREATE_SCN                                         NUMBER
 TOTAL_SIZE                                         NUMBER
 BLOCK_SIZE                                         NUMBER
 RECOVERY_STATUS                                    VARCHAR2(8)
 SNAPSHOT_PARENT_CON_ID                             NUMBER

SQL> set line 200
SQL> select con_id,name,open_mode from v$pdbs;

    CON_ID NAME                                                         OPEN_MODE
---------- ------------------------------------------------------------ --------------------
         2 PDB$SEED                                                     READ ONLY
         3 PDB1                                                         READ WRITE
         4 PDB2                                                         READ WRITE
         5 PDB3                                                         READ WRITE
         6 PDB4                                                         READ WRITE

SQL>