In previous post we have seen various ways to connect with CDB and PDB.

Establish Connection in CDB and PDB

In this post we will see how we can Start and shutdown particular PDB and how to Start and shut down whole CDB.

1. How to Start Pluggable database

There are two ways possible

a) Connect to the pluggable database

SQL> show con_name

CON_NAME
------------------------------
PDB121

Issue startup command

SQL> startup
Pluggable Database opened.

b) Connect to CDB$ROOT and give the following command

SQL> alter pluggable database pdb121 open read write;

Pluggable database altered.

2. How to stop a pluggable database

We can shut down pluggable database in two ways. First is traditional method issuing shut down command after connecting to pluggable database using proper privilege.

a) Connect to a pluggable database

SQL> alter session set container=pdb121;

Session altered.

SQL> show con_name

CON_NAME
------------------------------
PDB121

Issue shutdown command.

SQL> shut immediate;
Pluggable Database closed.

b) Connect to CDB$ROOT and give the following command to shut down the pluggable database

SQL> alter pluggable database pdb121 close;

Pluggable database altered.

We can also close all pluggable database using the following command

SQL> alter pluggable database all close;

Pluggable database altered.

To close all PDBs except some PDBs we can use PDBs.

SQL> alter pluggable database all except pdb121 close;

Pluggable database altered.

3. Starting CDB database

[oracle@localhost admin]$ sqlplus / as sysdba

SQL*Plus: Release 12.1.0.2.0 Production on Tue Aug 14 06:10:37 2018

Copyright (c) 1982, 2014, Oracle.  All rights reserved.

Connected to an idle instance.

SQL> startup
ORACLE instance started.

Total System Global Area  914358272 bytes
Fixed Size		    2930800 bytes
Variable Size		  339740560 bytes
Database Buffers	  566231040 bytes
Redo Buffers		    5455872 bytes
Database mounted.
Database opened.
SQL> select name,open_mode from v$database;

NAME	  OPEN_MODE
--------- --------------------
CDB121	  READ WRITE

4. Shut down CDB

SQL> show con_name

CON_NAME
------------------------------
CDB$ROOT
SQL> shut immediate
Database closed.
Database dismounted.
ORACLE instance shut down.

Stay tuned for More articles on Oracle Multitenant

Thank you for giving your valuable time to read the above information.

If you want to be updated with all our articles send us the Invitation or Follow us:

Telegram Channel: https://t.me/helporacle

Skant Gupta’s LinkedIn: www.linkedin.com/in/skantali/

Joel Perez’s LinkedIn: Joel Perez’s Profile

LinkedIn Group: Oracle Cloud DBAAS

Facebook Page: OracleHelp

About The Author

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.