List all Oracle databases, CDBs, and PDBs using SQL*Plus or SQL Developer queries on dynamic performance views.
Use dynamic performance views (V$DATABASE, V$PDBS) or the SHOW PDBS command to list all Oracle databases and pluggable databases in a multi-tenant environment.
Run SELECT name FROM v$database;
in SQL*Plus or SQL Developer. The query returns the single database name managed by your Oracle instance.
Connect to the container database (CDB$ROOT) and execute SHOW PDBS;
or query V$PDBS
. Each row represents a PDB that can host its own schemas like Customers
and Orders
.
V$PDBS
lets you filter, join, and aggregate inside SQL, enabling checks such as the number of PDBs in OPEN mode or joined analytics across environments.
Yes. After identifying the target PDB (e.g., ECOM_PDB
), switch with ALTER SESSION SET CONTAINER = ECOM_PDB;
and run ecommerce queries like SELECT COUNT(*) FROM customers;
.
Always connect as a common user (e.g., SYS
or a DBA role) in the root container. Grant only SET CONTAINER
and SELECT
privileges required for auditing.
Use DBA_PDBS
for metadata available to DBAs, or ALL_PDBS
for user-level visibility. These views provide creation times, service names, and open modes in a single call.
You need the SELECT_CATALOG_ROLE or explicit SELECT privilege on V_$PDBS.
Yes. A common user with SET CONTAINER and SELECT on V$PDBS can list PDBs.
In non-CDB architecture, one instance hosts one database. In multi-tenant (CDB) mode, an instance hosts one CDB that contains multiple PDBs.