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.
Hi! I am Bruno, a Brazilian born and bred, and I am also a naturalized Swedish citizen. I am a former Oracle ACE and, to keep up with academic research, I am a Computer Scientist with an MSc in Data Science and another MSc in Software Engineering. I have over ten years of experience working with companies such as IBM, Epico Tech, and Playtech across three different countries (Brazil, Hungary, and Sweden), and I have joined projects remotely in many others. I am super excited to share my interests in Databases, Cybersecurity, Cloud, Data Science, Data Engineering, Big Data, AI, Programming, Software Engineering, and data in general.
(Continue reading)