In-depth Oracle Learning Notes (6)---storage structure of Oracle Architecture

Source: Internet
Author: User
Tags dba

[Disclaimer: This article is a study of the famous Oracle DBA Mr. Gai's masterpiece, "In-depth analysis of ORACLE--DBA introductory step and diagnosis case," the study notes and experience. In this statement, the text extracts some of the contents of the book, not for the purpose of plagiarism, but on the impression that Mr. Gai wrote really classic. In this statement to the original author of respect and admiration. ]

Fifth (PRE) Oracle Storage architecture

The Oracle database storage structure is divided into logical storage structure and physical storage structure.
One: physical storage structure
Describes the external storage structure of an Oracle database, that is, how to organize and manage data in the operating system. The physical storage structure is associated with the operating system.
A realistic data storage unit that corresponds to an operating system file.
Includes control files, data files, redo log files, and other files.
1. Control file:
A binary small file size between 1--5m is the brain of the Oracle database. It is critical to Oracle's startup and operation, which stores Oracle's information, most of which is not available elsewhere:
The name of the database, which exists in the initialization parameter file and must exist. In fact, this parameter is also present in Oracle in order to correspond to the initialization parameters.
The name, location, size, status (online/offline) of the data file/redo log file.
Information that is used to recover the database (log sequence number, checkpoint) when a disk failure or user error occurs.
Control files are indispensable and not error-prone during the loading and opening stages of database startup. As the database runs, Oracle modifies the contents of the control file whenever a database checkpoint (checkpoint) or a database structure is modified.
After Oracle installation, 3 control files are automatically created, and the 3 files will remain absolutely consistent from the moment they are born, to backup, and despite this backup mechanism, each database must be and only one control file is required. This is a function of the ibdata file of MySQL's InnoDB storage engine.
2. Data file:
A data file is an operating system file that stores the actual data. The size of the data file can be changed.
A table space is physically corresponding to several data files, and a data file can only belong to a single table space.
When you create a tablespace, Oracle automatically creates the first data file for that table space. When the space of a data file in a tablespace is exhausted, you need to add storage space for the tablespace: or create a new data file. Either adjust the size of the existing data file storage space.
In addition to the system tablespace, any tablespace can be switched offline by online status for backup. Cannot be backed up when online.
3. Redo log files (redo file):
In memory, Oracle changed data is "immediately" written to the redo log file before being written to the data file, which can be used to recover lost data once the system fails.
This is done for performance reasons.
Oracle uses the redo log file in a circular fashion, requiring at least 2 redo log files, the first one is full, the background process LGWR will write a second redo log file, and when the second one is full, start writing the first one. In this loop.
The redo log file can be archived, provided that the automatic archiving feature is turned on so that all the changes are saved and any data can be recovered.
After Oracle installation, 3 redo log files are automatically created, and these 3 files are recycled.
4. Other documents
Initialization parameter file: Stores the SGA, background process configuration parameters, Oracle attribute configuration parameters. The my.cnf in MySQL plays the same role as this file.
. password file: A binary file in which users authenticate Sysdba/sysoper permissions. These users can start/close instances, create databases, perform backup/restore, and so on.
. alert files: Logs the errors and messages written by the server process, the background process. You can diagnose database status or failures, monitor database changes, and so on by viewing the file.

. Background process trace files: Each background process has a corresponding trace file. Log a warning or error message for the background process.
. Server process trace files: Tracking SQL statements, diagnosing SQL performance. You must activate SQL tracing before you can use this feature (Sql_trace=true).
. Archive log file: Redo log file backup. Keep all redo history. Turn on archive mode.
. Listener log files, trace files: Record the start time of the listener, the port being monitored, what machine is running, what knowledge has been established, and so on.
Two: logical storage structure
Describes the internal storage structure of Oracle databases, which describes how to organize and manage data in an Oracle database from a technical concept. Therefore, the logical storage structure is independent of the operating system and is defined, created, and managed by the Oracle database.
Includes: Table space, segment, area, block.
1. Table Space (tablespace):
The table space is the largest logical unit. A database consists of multiple table spaces, a table space can contain multiple data files, and a data file can belong to only one tablespace. Any database object is stored logically in a tablespace,
is also physically stored in the data file.
When the Oracle database is created, the automatically created table spaces include example Tablespace, Sysaux tablespace, System tablespace, temp table space, UNDOTBS1 tablespace, users table space.
. system table Space Storage information: Table space name, control file, data dictionary, database object definition, Pl/sql code, System undo segment.
. Sysaux tablespace: is introduced by Oracle 10g, auxiliary system table space, improve efficiency.
. Temp tablespace: Performs large classification operations, storing temporary data.
is stored in the system tablespace, the data of the database object is stored in the data table space of the object, often the user table space of the user.
2. Paragraph (segment):
A segment is a storage space for objects such as tables, indexes, clusters, and so on. such as the table section, the table section, the index section, the index partition section, the temporary paragraph, the fallback section, the cancellation section, the binary Big object section and so on.
3. District (extent):
A zone is made up of multiple, physically contiguous Oracle blocks. is the smallest unit of Oracle storage allocation.
4. Blocks (block):
Oracle's smallest data management unit, the smallest unit of input and output in data management. Oracle reads the smallest data each time must read a block out.
The size of the Oracle block is an integral multiple of the operating system block, and larger blocks are common in the Data Warehouse, which makes the B-tree lighter and improves performance.
Therefore, it is very important to the database performance for the different reasonable block size of the business.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.