Logo ← PostgreSQL Blog

Pluggable Database Command

— — — — — — — — — -— — — — — — — — — — — - create pluggable database pdb1 admin user root identified by test123; alter pluggable database…

Managing Pluggable Databases in Oracle 19c: A Step-by-Step Guide

Oracle Multitenant architecture introduced the concept of pluggable databases (PDBs), allowing multiple PDBs to be consolidated within a single Oracle Container Database (CDB). Managing PDBs efficiently is crucial for database administrators to optimize resources and enhance flexibility. In this article, we’ll explore various PDB management commands and operations in Oracle 19c.

Creating Pluggable Databases

Creating a new PDB involves specifying the administrative user and password. Here’s how you can create a PDB named pdb1:

create pluggable database pdb1 admin user root identified by test123;

To open the newly created PDB:

alter pluggable database pdb1 open;

Listing Pluggable Databases

You can list all PDBs within a CDB using the show pdbs command:

show pdbs;

Managing Multiple PDBs

To open all PDBs in a CDB:

alter pluggable database all open;

To create a new PDB pdb4 from an existing PDB pdb3:

create pluggable database pdb4 from pdb3;

To close and drop a PDB:

alter pluggable database pdb4 close immediate;
drop pluggable database pdb4 including datafiles;

Connecting to Specific PDBs

You can connect to a specific PDB using SQL*Plus:

sqlplus sys/test123@new_database as sysdba

Real-world Examples

Let’s consider some real-world examples to illustrate PDB management:

-- Creating new PDBs
create pluggable database yol2 from yol1;
create pluggable database yol3 from yol1;
-- Listing PDBs
show pdbs;
-- Altering PDBs
alter pluggable database all open;
-- Listing PDBs after alteration
show pdbs;

Conclusion

Managing pluggable databases in Oracle 19c offers flexibility and scalability for database administrators. By understanding and utilizing the various PDB management commands and operations, you can efficiently manage and optimize your Oracle Multitenant environment.

Whether you’re creating new PDBs, listing existing ones, or altering their states, Oracle 19c provides a comprehensive set of commands to meet your database management needs.

Mastering PDB management is essential for leveraging the full potential of Oracle Multitenant architecture and ensuring optimal resource utilization in your Oracle 19c database environment.

Happy managing!