To determine whether a database is a CDB or a non CDB, execute the below query :-
SQL> SELECT CDB FROM V$DATABASE;
CDB
---
YES
## Let us check about each Container in a CDB
We will query the V$CONTAINERS view.
SQL> COLUMN NAME FORMAT A8
SQL> SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;
NAME CON_ID DBID CON_UID GUID
-------- ---------- ---------- ---------- --------------------------------
CDB$ROOT 1 862823670 1 FD9AC20F64D344D7E043B6A9E80A2F2F
PDB$SEED 2 3526827491 3526827491 1E8418ECE0501751E05372C909C0C35E
PDB1 3 1620003564 1620003564 1E84263113671CB0E05372C909C0893F
PDB2 4 2018651655 2018651655 1E84287383001DBEE05372C909C012F3
PDB2_11 5 938823506 938823506 1E851D182997251BE05372C909C034B6
PDB_22 6 2820822967 2820822967 1E85456E7EFC246EE05372C909C08EA3
6 rows selected.
Lets check container ID, Name, and Status of Each PDB
SQL> COLUMN PDB_NAME FORMAT A15
SQL> SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS ORDER BY PDB_ID;
PDB_ID PDB_NAME STATUS
---------- --------------- ---------
2 PDB$SEED NORMAL
3 PDB1 NORMAL
4 PDB2 NORMAL
5 PDB2_11 NORMAL
6 PDB_22 NEW
SQL> SELECT CDB FROM V$DATABASE;
CDB
---
YES
## Let us check about each Container in a CDB
We will query the V$CONTAINERS view.
SQL> COLUMN NAME FORMAT A8
SQL> SELECT NAME, CON_ID, DBID, CON_UID, GUID FROM V$CONTAINERS ORDER BY CON_ID;
NAME CON_ID DBID CON_UID GUID
-------- ---------- ---------- ---------- --------------------------------
CDB$ROOT 1 862823670 1 FD9AC20F64D344D7E043B6A9E80A2F2F
PDB$SEED 2 3526827491 3526827491 1E8418ECE0501751E05372C909C0C35E
PDB1 3 1620003564 1620003564 1E84263113671CB0E05372C909C0893F
PDB2 4 2018651655 2018651655 1E84287383001DBEE05372C909C012F3
PDB2_11 5 938823506 938823506 1E851D182997251BE05372C909C034B6
PDB_22 6 2820822967 2820822967 1E85456E7EFC246EE05372C909C08EA3
6 rows selected.
Lets check container ID, Name, and Status of Each PDB
SQL> COLUMN PDB_NAME FORMAT A15
SQL> SELECT PDB_ID, PDB_NAME, STATUS FROM DBA_PDBS ORDER BY PDB_ID;
PDB_ID PDB_NAME STATUS
---------- --------------- ---------
2 PDB$SEED NORMAL
3 PDB1 NORMAL
4 PDB2 NORMAL
5 PDB2_11 NORMAL
6 PDB_22 NEW
No comments:
Post a Comment