新特性:CDB/PDB的维护命令:开启/关闭pdb的2种方法

方法1:

SQL> show pdbs 

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1_WHS                       MOUNTED
SQL> alter pluggable database PDB1_WHS open;

Pluggable database altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1_WHS                       READ WRITE NO

SQL>  alter pluggable database PDB1_WHS close immediate;

Pluggable database altered.

SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         2 PDB$SEED                       READ ONLY  NO
         3 PDB1_WHS                       MOUNTED
SQL> 

方法2:


SQL> alter session set container=PDB1_WHS;

Session altered.

SQL> startup   
Pluggable Database opened.
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PDB1_WHS                       READ WRITE NO
SQL> alter session set container=PDB1_WHS;

Session altered.

SQL> shutdown immediate
Pluggable Database closed.
SQL> show pdbs

    CON_ID CON_NAME                       OPEN MODE  RESTRICTED
---------- ------------------------------ ---------- ----------
         3 PDB1_WHS                       MOUNTED
SQL> 

Related Posts