After opening CDT root database by default all PDB are in the mount state , In 12.2 release we have option to make PDB in desired state
KEYWARDS:
- ALTER PLUGGABLE DATABASE (pdb_name) SAVE STATE;
- ALTER PLUGGABLE DATABASE (pdb_name) DISCARD STATE;
Example :
oracle@srv3:/u01/app/oracle/product/12.2.0/dbhome_1/network/admin> sqlplus / as sysdba
SQL*Plus: Release 12.2.0.1.0 Production on Wed Aug 5 19:53:22 2020
Copyright (c) 1982, 2016, Oracle. All rights reserved.
Connected to:
Oracle Database 12c Enterprise Edition Release 12.2.0.1.0 - 64bit Production
- SQL> sho pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 READ WRITE NO
5 PDB3 READ WRITE NO
- SQL> ALTER PLUGGABLE DATABASE ALL SAVE STATE;
- SQL> col CON_NAME for a40
- SQL> SELECT CON_NAME, STATE FROM DBA_PDB_SAVED_STATES;
CON_NAME STATE
---------------------------------------- --------------
PDB2 OPEN
PDB1 OPEN
PDB3 OPEN
- SQL> show pdbs
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 READ WRITE NO
5 PDB3 READ WRITE NO
- SQL> shut immediate;
Database dismounted.
ORACLE instance shut down.
- SQL> startup
Total System Global Area 1795162112 bytes
Fixed Size 8793832 bytes
Variable Size 704643352 bytes
Database Buffers 1073741824 bytes
Redo Buffers 7983104 bytes
Database mounted.
Database opened.
- SQL> show pdbs
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 READ WRITE NO
5 PDB3 READ WRITE NO
- SQL> ALTER PLUGGABLE DATABASE ALL DISCARD STATE;
- SQL> sho pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 READ WRITE NO
4 PDB2 READ WRITE NO
5 PDB3 READ WRITE NO
- SQL> shut immediate;
Database dismounted.
ORACLE instance shut down.
- SQL> startup
Total System Global Area 1795162112 bytes
Fixed Size 8793832 bytes
Variable Size 704643352 bytes
Database Buffers 1073741824 bytes
Redo Buffers 7983104 bytes
Database mounted.
Database opened.
- SQL> sho pdbs
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB1 MOUNTED
4 PDB2 MOUNTED
5 PDB3 MOUNTED
No comments:
Post a Comment