Managing the availability of a portable collection of schemas, schema objects, and non-schema objects in an Oracle multitenant database

This post serves as a reference to close and open PDB databases. I have been mentoring some colleagues on the way to a data and database management career. As we have been managing Oracle multitenant environments quite often, I decided to create an example where they can easily visualize and have a reference on it. I made another blog post where one can imagine the existence of PDBs (https://www.techdatabasket.com/2018/11/08/how-to-check-if-my-database-is-a-cdb-database-or-not/). Thus, follow below is the representation of the closing and opening of a database instance named TECHDB in an Oracle RAC configuration with three nodes:


-- CLOSE INSTANCES

SQL> alter pluggable database techdb close immediate instances=('techdb1'); ##for close techdb at node 3 
SQL>alter pluggable database techdb close immediate instances=('techdb2'); ##for close techdb at node 2 
SQL> alter pluggable database techdb close immediate instances=('techdb3'); ##for close techdb at node 1

-- CLOSE ALL PDB INSTANCES AT ONCE

SQL> alter pluggable database close immediate; 

-- OPEN INSTANCES
 
SQL>alter pluggable database techdb open instances=('techdb3'); ##for close techdb at node 3 
SQL>alter pluggable database techdb open instances=('techdb2'); ##for close techdb at node 2 
SQL>alter pluggable database techdb open instances=('techdb1'); ##for close techdb at node 1

-- OPEN ALL PDB INSTANCES AT ONCE
 
SQL>alter pluggable database all open instances=ALL; ## open all PDB

-- THERE IS ALSO AN OPTION TO SAVE THE CURRENT STATE OF THE PDBs with the "SAVE STATE" OPTION:

SQL>ALTER PLUGGABLE DATABASE ALL SAVE STATE;  

Additionally, there are many other examples and options in chapter 15 Administering PDBs of the Release 19 Administrator’s Guide. For previous versions for example at version 12c, the information is under chapter 40 Administering a CDB with SQL*Plus. Therefore, I hope this post can be helpful to you.

Related posts

Leave a Comment