2.4 CDB_* Views

For every DBA_* view, a CDB_* view is defined. In the root of a multitenant container database (CDB), CDB_* views can be used to obtain information about tables, tablespaces, users, privileges, parameters, and so on contained in the root and in pluggable databases (PDBs).

The CDB_* views can be queried only by users with the SYSDBA system privilege or SELECT ANY DICTIONARY privilege, or SELECT_CATALOG_ROLE role, or by users with direct privileges granted to them.

CDB_* views are container data objects. When a user connected to the root queries a CDB_* view, the query results will depend on the CONTAINER_DATA attribute for users for the view. The CONTAINER_DATA clause of the SQL ALTER USER statement is used to set and modify users' CONTAINER_DATA attribute.

The CDB_* views are owned by SYS, regardless of who owns the underlying DBA_* view.

By default, a user connected to the root will only see data pertaining to the root.

See Also:

CDB_* views include these hidden columns:

  • CON$NAME: This column includes the name of the container whose data a given CDB_* row represents

  • CDB$NAME: This column displays the name of the CDB whose data a given CDB_* row represents

In a PDB, the CDB_* views only show objects visible through a corresponding DBA_* view.

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 will be 0.

CDB views can return data from different containers in a CDB when queried from the root container. These objects will implicitly convert data to the character set of the root container (AL32UTF8) and then return the result to the user. Some character sets may have character expansion (more bytes needed to represent a character) when converted to AL32UTF8, so there may be data truncation if the view column width is not able to accommodate data from a given PDB.

Data is returned by these views from all open PDBs at the time the query is issued, except for PDBs that are open in RESTRICTED mode. In an Oracle RAC environment, data returned by these views may vary according to the instance to which a session is connected.