In a CDB, for every DBA_* view, a CDB_* view is defined.
- In the root, CDB views can be used to obtain information about tables, tablespaces, users, privileges, parameters, PDBs and other types of objects contained in the root and all PDBs.
- In a PDB, the CDB_* views show objects visible through a corresponding DBA_* view only.
In addition, to all the columns found in a given DBA_* view, the corresponding CDB_* view also contains the CON_ID column, which identifies a container whose data a given CDB_* row represents. In a non-CDB, the value of a CON_ID column is 0. In a CDB, the value can be either 1 used for rows containing data pertaining to the root only or n where n is the applicable container ID.
Examples of CDB views:
- Connected to the root and querying CDB_USERS, you get the list of users, common and local, of each container.
- Connected to a PDB and querying CDB_USERS or DBA_USERS, you get the same list of
- users, common and local, of the PDB.
- Connected to the root and querying the CDB_PDBS view, you get the list of all PDBs.
- Querying the CDB_TABLESPACES view, you get the list of all tablespaces of all PDBs.