Subscribe to Posts by Email

Subscriber Count

    699

Disclaimer

All information is offered in good faith and in the hope that it may be of use for educational purpose and for Database community purpose, but is not guaranteed to be correct, up to date or suitable for any particular purpose. db.geeksinsight.com accepts no liability in respect of this information or its use. This site is independent of and does not represent Oracle Corporation in any way. Oracle does not officially sponsor, approve, or endorse this site or its content and if notify any such I am happy to remove. Product and company names mentioned in this website may be the trademarks of their respective owners and published here for informational purpose only. This is my personal blog. The views expressed on these pages are mine and learnt from other blogs and bloggers and to enhance and support the DBA community and this web blog does not represent the thoughts, intentions, plans or strategies of my current employer nor the Oracle and its affiliates or any other companies. And this website does not offer or take profit for providing these content and this is purely non-profit and for educational purpose only. If you see any issues with Content and copy write issues, I am happy to remove if you notify me. Contact Geek DBA Team, via geeksinsights@gmail.com

Pages

12c Database : How does data dictionary will be shared for multiple databases?

Architecture of Data dictionary in view of multiple containers in a Single SGA

image

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 and DBA_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:

Description of cncpt_vm_366.png follows

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

Comments are closed.