Non-CDB Oracle Database vs Single/Multitenant (CDB/PDB) Oracle Database and how to identify

In Oracle Database, there are two main architectures: Non-CDB (non-container database) and CDB (container database) with PDBs (pluggable databases). Here’s a comparison of these architectures and a method to identify which type of database you are using:

 

 Non-CDB (Non-Container Database)

 

- Architecture: Traditional database architecture where the database instance and data dictionary exist independently.

- Isolation: Each database is isolated and managed separately.

- Resources: All resources (memory, processes) are dedicated to that single database.

- Management: Simpler but less flexible for managing multiple databases.

- Version: Available in older versions of Oracle Database but deprecated in Oracle 12c and later versions.

 

 CDB (Container Database) with PDBs (Pluggable Databases)

 

- Architecture: Introduced in Oracle 12c, the CDB architecture includes a root container (CDB$ROOT) and one or more pluggable databases (PDBs).

- Isolation: PDBs are logically isolated but share the common resources of the CDB.

- Resources: Shared among multiple PDBs, which can lead to more efficient resource utilization.

- Management: More complex but offers easier management of multiple databases within a single CDB.

- Flexibility: Supports rapid cloning, provisioning, and migration of PDBs.

 

 Identifying Your Oracle Database Type

 

You can identify whether your Oracle database is a Non-CDB or a CDB with PDBs by querying certain views in the database. Here's how you can do it:

 

# Step 1: Connect to the Database

 

First, connect to your Oracle database using SQL*Plus or another database connection tool.

 

```sql

sqlplus / as sysdba

```

 

# Step 2: Check the Database Type

 

Execute the following query to determine if the database is a Non-CDB or a CDB with PDBs:

 

```sql

SELECT NAME, CDB FROM V$DATABASE;

```

 

- If the `CDB` column returns `YES`, your database is a CDB.

- If the `CDB` column returns `NO`, your database is a Non-CDB.

 

# Step 3: Additional Checks for CDB

 

If your database is a CDB, you can further check for the presence of PDBs:

 

```sql

SELECT CON_ID, NAME, OPEN_MODE FROM V$PDBS;

```

 

This query will list all the PDBs within the CDB, along with their container IDs (CON_ID) and open modes.

 

 Example Outputs

 

# Non-CDB Database

 

```sql

SQL> SELECT NAME, CDB FROM V$DATABASE;

 

NAME       CDB

---------  ---

ORCL       NO

```

 

# CDB with PDBs

 

```sql

SQL> SELECT NAME, CDB FROM V$DATABASE;

 

NAME       CDB

---------  ---

CDB1       YES

 

SQL> SELECT CON_ID, NAME, OPEN_MODE FROM V$PDBS;

 

CON_ID  NAME       OPEN_MODE

------  ---------  ----------

2       PDB$SEED   READ ONLY

3       PDB1       READ WRITE

4       PDB2       MOUNTED

```

 

 Summary

 

- Non-CDB: Single standalone database, simpler architecture, and dedicated resources.

- CDB/PDB: Container database with one or more pluggable databases, shared resources, and greater flexibility for managing multiple databases.

 

By running the provided queries, you can easily determine whether your Oracle database is a Non-CDB or a CDB with PDBs.


Akash

I am working as a Data Engineer

Post a Comment

Previous Post Next Post