Sunday , June 16 2024

Multitenant Database in Oracle

What is a Multitenant Database?

As of version 12.1, you can design your databases as a multitenant database (CDB). It consists of a container database, 1 root container, one seed pluggable database (seed PDB), and one or more users’ pluggable databases (PDB).

PDB acts as a database that is logically reserved for a user or application. If necessary, non-container databases can be configured in the old method.

The following image shows the container database structure.

  • The root container (CDB$ROOT) contains multiple datafiles. These files contain metadata information and common user information provided by Oracle. This information is distributed to all PDBs.
  • Seed PDB (PDB$SEED) is a template PDB for the pluggable database(PDB) that users will create. The Seed PDB (PDB $ SEED) ‘s container id is always 2 (two) and is readonly database.
  • The PDBs that users create will contain many datafiles. These data files contain application data.

Switch Pluggable Database

When working in container databases, you can switch between databases with the command alter session set container.

Show Current Container

You can find out the current container with the following commands.

While you are in root container, you can query all pluggable databases and containers as follows.


About dbtut

We are a team with over 10 years of database management and BI experience. Our Expertises: Oracle, SQL Server, PostgreSQL, MySQL, MongoDB, Elasticsearch, Kibana, Grafana.

Leave a Reply

Your email address will not be published. Required fields are marked *