Save state of Pluggable database in Oracle
Pluggable Database Saved State in Oracle
Saved State is a feature in Oracle for saved the OPEN state of all PDBS when CDB is restart. It will bring PDBs to same state if it open then it bring the PDB in Open State or if PDB is closed when CDB restart then it bring PDB in closed state. Open the database in READ-WRITE/READ-ONLY mode it save state.
Check the Save State for PDBS
select a.name,b.state from v$pdbs a , dba_pdb_saved_states b where a.con_id = b.con_id;
SELECT con_name, instance_name, state FROM cdb_pdb_saved_states;
When database gets unplug and plug this saved state will be lost.
Save the existing State of PDB
alter pluggable database PDB1 save state;
Pluggable database altered.
Discard or unsaved the existing state of PDB
alter pluggable database HYDB discard state;
Pluggable database altered.
Show the pdbs
Show pdbs
Preserving the Open Mode of All PDBs
ALTER PLUGGABLE DATABASE ALL SAVE STATE;
Preserving the Open Mode of Multiple PDBs
ALTER PLUGGABLE DATABASE PDB1 , PDB2 SAVE STATE;
Preserving the Open Mode of All PDBs Except
ALTER PLUGGABLE DATABASE ALL EXCEPT PDB3, PDB4 SAVE STATE;
SQL> alter pluggable database PDB open read write instances=all;
Pluggable database altered.
SQL> show pdbs;
CON_ID CON_NAME OPEN MODE RESTRICTED
---------- ------------------------------ ---------- ----------
2 PDB$SEED READ ONLY NO
3 PDB READ WRITE NO
SQL> alter pluggable database pdb save state;
Pluggable database altered.
Comments
Post a Comment