In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-14 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces how the data dictionary structure of CDB database in Oracle12c is. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.
A data dictionary is a collection of metadata, such as created tables, columns, constraints, triggers, and so on, which are metadata that need to be saved to the database. In addition, some of Oracle's own database objects, such as directories, PL/SQL code, and so on, are metadata and need to be stored in data dictionaries. With the popularity of 12c container data, what changes have taken place in the Oracle data dictionary, which is described in detail below.
1. Data dictionary and its formation 1. Data dictionary
A data dictionary is a collection of metadata, which logically and physically describes the database and its contents, and stores several segments in the SYSTEM and SYSAUX tablespaces.
SYS users have all the data dictionary tables, which are generally based on the formation of data dictionaries.
Create during the database creation phase, maintain and update during the usage phase
Can not be modified through the DML operation, only through the relevant commands to modify the system, to indirectly modify the data dictionary.
3. The contents of the data dictionary
Definition information for database objects
User-defined information
PL/SQL code
Other objects created by the user, etc.
For more information on data dictionaries, please refer to: Oracle data Dictionary and data Dictionary View
2. The structure of the data dictionary in the CDB database 1. The change of the storage mode of the data dictionary
In the database version before Oracle 12c, the system data dictionary and the user data dictionary adopted the mixed storage mode.
Separate storage is adopted in Oracle 12c CDB database, and each PDB data dictionary is stored independently.
From a user and application perspective, the data dictionary in each container in CDB is separate because it will be in a non-CDB.
2. Schematic diagram of non-CDB mixed data dictionary
In a newly created non-CDB that does not contain user data, the data dictionary contains only system metadata.
For example, the TAB$ table contains rows that describe only the tables provided by Oracle, such as TRIGGER$ and SERVICE$.
As user database objects are added to the database, the object information added by the user is mixed into the system data dictionary (that is, the data object dictionary provided by Oracle).
The following figure depicts two basic data dictionary tables
In the icon on the left, the black bar represents the row that describes the system data dictionary, and the green bar represents the row generated by the user object to the data dictionary table.
3. Schematic diagram of CDB separated data dictionary
In CDB, the data dictionary metadata is split between the root and the PDB.
In the following figure, the tables emp and dept are located in PDB. The data dictionary of the user data also resides in PDB. Therefore, the table in TAB$PDB has rows of the emp table and rows of the table dept.
How to access the system objects (system-level data dictionary) provided by Oracle? Oracle is implemented by means of internal pointers.
The following figure shows that the data dictionary in PDB contains a pointer to the data dictionary in the root. Internally, objects provided by Oracle, such as data dictionary table definitions and PL / SQL packages, are represented only in the root.
This architecture achieves two main goals within CDB:
? Reduce repetition
? For example, instead of storing the source code of the PL / SQL package in each PDB, DBMS_ADVISORCDB stores it in CDB$ROOT, saving disk space.
? Easy to upgrade database
? If the definition of the data dictionary table exists in each PDB, and if the definition changes in the new version, each PDB will need to be upgraded separately to capture the changes. Storing the table definition in the root eliminates this problem only once.
4. Metadata and data links
CDB uses an internal linking mechanism to separate data dictionary information.
Specifically, the Oracle database uses the following automatically managed pointers:
Metadata link
The Oracle database stores metadata about dictionary objects only in the CDB root directory. For example, the column definition DBA_OBJECTS of the OBJ$ dictionary table under the data dictionary view exists only in the root directory. As shown in the previous illustration, OBJ$ uses metadata links called internal mechanisms in each PDB table to point to the OBJ$ stored in the root definition.
?? This data corresponds to the metadata link that resides at its PDB, not at the root. For example, if you add rows to the table mytable on hrpdb, and then store the rows in the PDB data file. The data dictionary view in the PDB and root contains different rows. A new row of the description table mytable is added to the OBJ$, of hrpdb but does not exist in the OBJ$ in the root directory of CDB. Therefore, the query DBA_OBJECTS shows different results in the CDB root and DBA_OBJECTS in the hrdpb.
Data link
?? Note:
Data links in Oracle database 12 c version 1 (12.1.0.2) are called object links.
?? In some cases, the Oracle database stores the data of an object (not just metadata) in the application root directory. The application PDB uses an internal mechanism called data linking to reference objects in the application root directory. The application PDB that created the data link also stores the data link description. A data link inherits the data type of the object it involves.
Extended data link
?? Extended data link is a mixture of data link and metadata link. Like data links, extended data links refer to objects in the root directory of the application. However, the extended data link also references the corresponding object in the PDB. Like metadata links, objects in the application PDB inherit metadata from the corresponding objects in the application root directory.
?? When querying in the application root directory, the extended data link object only gets rows from the application root directory. However, when querying in the application PDB, the extended data link object fetches rows from the application root and the application PDB.
The Oracle database automatically creates and manages metadata and data link CDB$ROOT. Users cannot add, modify or delete these links.
Third, data dictionary view
After CDB is enabled, there are also some changes in data dictionary-related views, mainly due to the addition of CDB-related views. As shown in the following figure:
On the Oracle12c CDB database data dictionary structure is shared here, I hope that the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.