Architecture of Data dictionary in view of multiple containers in a Single SGA
The above diagram requires a explanation.
Data Dictionary
- A data dictionary resides in CDB is shared (definitions) between CDB & PDB, for those objects that are system (internal) For example: AWR is global, TAB$, OBJ$ etc.A data dictionary objects or tables such as obj$ or tab$ or DBA_VIEWS or DBMS_PACKAGE a pointer to PDB called Metadata Link (Red Line)
- A data dictionary objects
DBA_HIST_ACTIVE_SESS_HISTORY
andDBA_HIST_BASELINE
such as DBMS packages will have a pointers called Object Links (Blue Lines). This is because we don’t need all tables to be created here rather the awr data only we need for that PDB ,, a reference is enough to read the data. - A data dictionary in PDB contains the local data such emp , dept tables in tab$ reflect only PDB not in the CDB database, only TAB$ definition will have a metadata pointer link.
For example of metalink, if you create table mytable
in hrpdb
and add rows to it, then the rows are stored in the PDB files. The data dictionary views in the PDB and in the root contain different rows. For example, a new row describing mytable
exists in the OBJ$
table in hrpdb
, but not in the OBJ$
table in the root. Thus, a query of DBA_OBJECTS
in the root and DBA_OBJECTS
in hrdpb
shows different result sets.
For example of object Link, Oracle Database stores the data (not metadata) for an object only once in the root. For example, AWR data resides in the root. Each PDB uses an internal mechanism called an object link to point to the AWR data in the root, thereby making views such as DBA_HIST_ACTIVE_SESS_HISTORY
and DBA_HIST_BASELINE
accessible in each separate container
Container Objects in CDB
A container data object is a table or view containing data pertaining to multiple containers and possibly the CDB as a whole, along with mechanisms to restrict data visible to specific common users through such objects to one or more containers. Examples of container data objects are Oracle-supplied views whose names begin with V$
and CDB
In a CDB, for every DBA_
view, a corresponding CDB_
view exists. The owner of a CDB_
view is the owner of the corresponding DBA_
view. The following graphic shows the relationship among the different categories of dictionary views:
Source: 12c Documentation.
For example:-
If you logged in a Root database and fire a query on DBA_USERS, that will show the users related to that database only not whole
If you logged in root database and fire a query on CDB_USERS, that will show all users (common) and local users which may be different from the DBA_USERS
If you logged into a PDB database and fire a query on DBA_USERS, that will show only the users that local to PDB not others
If you logged into a PDB database and fire a query on CDB_USERS, that will show only the users that are local, output will be similar like DBA_USERS only.
Note: DBA_* views only shows the current container data only.
-Thanks
Geek DBA
Follow Me!!!