In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
Why should directories learn architecture? Definition of architecture Oracle physical structure Oracle logical structure summary why learn architecture?
Previous articles have explained to MySQL, MongoDB database, these databases we installed can be used, for example, you can directly do some: add, delete, change, check and other operations. But the Oracle system is complex, if you do not understand the structure, then there are some problems in the production environment, do not know which link is the problem, so you need to understand the structure of Oracle, this will be more conducive to understand it, understand it, if there is a problem will know which part of the problem, you can solve it in time!
> Oracle installation Click: Oracle 12C installation and Startup > MySQL Database: MySQL High availability deployment > MongoDB fragmentation: MongoDB fragmentation principle and deployment
Definition of architecture
Its definition is the composition, working process and principle of the database, as well as the organization and management mechanism of the data in the database.
The Oracle server provides open, comprehensive and comprehensive information management, which consists of Oracle instances and Oracle databases. Oracle instance: is a collection of background processes and memory structures Oracle database: a database is a collection of data that can be regarded as a logical unit.
Oracle instance:
> Oracle instance role-- 1 allocate memory, that is, system global area (SGA) > Oracle instance role-- 2 start background process
Oracle database:
Oracle database: consists of operating system files that provide the actual physical storage area for database information. Oracle database: including logical structure and physical structure.
Oracle physical structure the storage structure of Oracle is divided into physical structure and logical structure! The two structures are independent and related to each other. It means that logical structures still have to be based on physical structures and complement each other! Oracle database logically consists of one or more table spaces, each table space is physically composed of one or more data files, and each data file is made up of data blocks. Therefore, the data is stored logically in the tablespace and physically in the data file corresponding to the tablespace.
The physical structure mainly includes the following parts:
Main documents:
Data file redo log file control file
Other documents:
Parameter files archive log files. And other data files: mainly used to store data redo log files: store changes to the data. At least two groups, Oracle uses them to control files in a circular way: storing the basic information of the database, telling the database to data files and redoing log files, etc. It is important for the successful startup and normal operation of the database. Parameter file: when starting the instance, you need to read the parameter file and find the relevant configuration to start the instance! Archive log files: all redo history can be retained, and when a media failure occurs in the database, the database can be fully restored by using data file backup, archive log and redo log. (no way is so powerful. 0. 0) Oracle logical structure
Oracle logically divides the saved data into small units for storage and maintenance, and the higher-level logical storage structure is composed of these basic small units.
Type of logical structure (large-> small):
Table space (tablespace)-> segment (segment)-> area (extent)-> block (block)
1. Tablespaces:
The most advanced logical storage structure, the database is made up of multiple table spaces. Some default tablespaces are created when the database is created, such as SYSTEM, SYSAUX, and so on. By using tablespaces, Oracle groups all related logical structures and objects together.
2 paragraphs:
Segments are the logical storage structures that make up tablespaces. Segments are made up of a set of areas that can be contiguous or discontiguous. When users create various objects in the database that have actual storage structures (objects that hold data), such as tables, indexes, and so on, Oracle creates "segments" for these objects. Generally, an object has only one segment. Different types of database objects have different types of segments.
3. Zone:
The zone allocates space for segments, which consists of consecutive data blocks, and it is the smallest unit that oracle allocates and reclaims storage space. A zone cannot exist across data files, it can only exist in one segment. When all the space in the segment is used up, the system will reassign an area to the segment. When Oracle creates a 'segment' for an object, it assigns an 'initial area' to the segment. The distribution mode of the subsequent area is different according to the space management method of the table.
4 yuan:
Is the smallest logical storage structure, Oracle in the output and input is carried out in blocks. The size of the block is determined when the database is created and cannot be modified later. Of course, oracle also supports different block sizes for different tablespaces.
Common tablespace:
Data tablespace: a regular tablespace used to store user data. System tablespace: the default tablespace, which is used to save the data dictionary (a group of internal system tables and views that save the information of the database, and other objects used internally in Oracle), to save the source code and parsing code of all PL/SQL programs, including stored procedures and functions, packages, database triggers, etc., and to save the definition of database objects (tables, views, sequences). Rollback tablespace: used to store rollback segments. Each instance can only use at most one undo tablespace temporary tablespace: store temporary data generated during SQL execution.
Different types of segments:
Data segment: save the record index segment in the table: temporary period of index entries in the index: when performing operations such as queries, Oracle may need to use some temporary storage space to temporarily store parsed query statements and temporary data generated during sorting. Rollback segment: save rollback data.
Recycle unused areas:
SQL > alter table table_name deallocate unused
Block header information area:
Block head: contains general attribute information of the block, such as the physical address of the block, the type of segment to which the block belongs to the table directory: if the data stored in the block is table data, then save the relevant information of the table contained in the block in the table directory: row directory: row record related information such as ROWID block storage area: mainly contains free space and space already used. Oracle is a PCTFREE parameter that manages this part of the space mainly through the following two parameters: specify the minimum proportion of free space that must be reserved in the block. When the free storage space in the block is reduced to the ratio set by PCTFREE, Oracle marks the block as unavailable and new rows of data cannot be added to the block. PCTUSED parameter: set a percentage, and when the percentage of storage space already used in the block is reduced to less than this percentage, the block is re-marked as available. Note that the above two parameters can be set either at the tablespace level or at the segment level. The setting at the segment level has higher priority. Summary: Oracle architecture is mainly divided into: instance and database. Example: it is composed of system SGA and background process. Database: divided into physical structure and logical structure. Physical structure: the main file is composed of other files. The main files include: data file, control file, redo log file. Other files include: parameter file, type of logical structure of archive log file (large-> small): tablespace (tablespace)-- > segment (segment)-> area (extent)-- > block (block)
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.