Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Analysis and understanding of Oracle database architecture and storage structure

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)06/01 Report--

I. Oracle architecture

Personal metaphor helps to understand: similar to the library, customers who go to the library (user process and service process, etc.) need to access information and turn to the librarian (example) to enter the book partition (database) for information search. [if the analogy is inappropriate, please correct it, please forgive me]

-

The first part is the example part (providing services for users and managing databases):

The main understanding is divided into two main parts:

(1) memory structure:

(2) background process: interact with database

-

The second part is the physical structure of the database: (providing services for examples, dealing with data files) main files: data files, control files, redo log files other files: archived log files, parameter files, password files, etc. 2. The storage structure of Oracle database is divided into physical structure and logical structure, which are independent and related to each other.

-

The physical structure includes: main files: data files, redo log files, control files, other files: parameter files, archive log files

-

Main documents:

Data files: contains user or application data of the database, as well as metadata and data dictionaries

Redo log file: used for instance recovery of the database. If the database server crashes but no data files are lost, the instance can use the information in those files to recover the database.

Control file: contains data related to the database itself, that is, physical database structure information. These files are critical to the database. Without these files, you cannot open the data file to access the data in the database.

-

Other files: parameter files: used to define the configuration when the instance is started

Parameter files (Parameter File), also known as initialization parameter files, are used to store SGA, optional Oracle features, and configuration parameters for background processes. When the database starts, and before creating routines or reading control files, routines are configured according to their parameters.

1) the legacy parameter file init.ora: it can be converted to SPFILE and needs to be modified manually

The file name contract defaults to

$SORACLE_ HOME/dbs/init$ORACLE_SID.ora

2) the server parameter file is currently in use and can be modified by command

The file name contract defaults to:

$SORACLE_HOME/dbs/spfile#$ORACLE_SID.ora

Note: it is recommended that you do not change the default location where the server parameter file is stored, otherwise you must tell Oracle where to find the file.

Password files: allow sysdba, sysoper, and Issas to remotely connect to the instance and perform administrative tasks to archive log files: use these files and database backups to recover lost data files. In other words, the logical structures of the data files that can be restored by the archive log include: table space, data block, range, segment, etc.

The order from large to small is as follows: database-> tablespace-> segment-> range-> Oracle data segment: the logical storage structure that constitutes the tablespace, and the segment consists of a set of extents. According to the characteristics of the data stored by the segment, the segment is divided into four types, namely, data segment, index segment, fallback segment and temporary segment area: the zone allocates space for the segment, which is composed of continuous data blocks. When all the space in the segment is fully used, the system automatically assigns a new area to the segment. A zone cannot exist across data files and can only exist in one segment. Block: a block is the smallest storage unit that an Oracle server can allocate, read, or write. The Oracle server manages the storage space of data files in blocks. Schema: a schema is a collection of database objects owned by database users. Schema objects include tables, views, indexes, synonyms, sequences, procedures, packages, etc. The tablespace is the largest logical unit in the database. SYSTEM and SYSAUX tablespaces are the necessary tablespaces that must be created when creating the database, and there will be TEMP, USERS and other tablespaces. Each tablespace is composed of one or more data files, and a data file can only be associated with one tablespace. The size of the tablespace is equal to the sum of all the data files that make up the tablespace.

The table space automatically created after installing Oracle mainly includes: SYSTEM system table space, which stores management information about table space name, control file, data file and so on. It belongs to sys and system mode. Cannot be deleted or renamed. SYSAUX auxiliary system table space is used to reduce the load of system table space, improve the efficiency of TEMP temporary table space, store temporary tables and temporary data, sort USERS user table space, store permanent user objects and private information, also known as data table space. Note: each database should have a user tablespace so that it can be assigned to the user when the user is created, otherwise the user's data will use the SYSTEM tablespace. UNDO redoes tablespaces to help roll back uncommitted transaction data

-

For example:

The picture above is as follows:

Two data files in one table space: / do1/user_data01.dbf and / do1/user_data02.dbf segments have three: two data segments [× × and T2], one index segment [I1] four blocks and 16 blocks

PS: segments can span data files. Zones cannot span data files.

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.

Share To

Database

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report