Oracle's architecture

Source: Internet
Author: User
Tags filegroup

Objective

This chapter is mainly about Oracle's architecture, which is also a strong theory. There are some more theoretical points of knowledge (such as table space AH), temporarily do not write, the next chapter began to enter the operational phase of Oracle, such as table query Ah, insert and focus on some differences with SQL 2005 and the specific commands in Oracle.

I hope you will continue to join us.

Oracle Architecture Classification

What we should know is that the architecture of the Oracle database consists of the following four structures:

Then I would rather roughly say the following structure includes what! ~

A. Physical storage Structure

As the name implies, the Oracle database is physically composed of the operating system files stored on the disk, the files that can be seen by us. The Oracle database is physically composed of 3 types of files, namely data Files (*.dbf), control Files (*.ctl), log files (*.log)

data file: Refers to the file that stores the database data, which is the database we created in the usual. For example, records in a table, indexes are stored in a data file. We need to note that when the user reads the data, if the user reads the data is not in the buffer (like our operating system also has a cache, in the computer in order to improve the performance of the system, put some common data in memory), then read from the database, put into memory. When storing the data, the data is saved to the buffer, and then the background process dbwn the data to the data file.

We can use Dba_data_files data dictionary (data dictionary is to store some system data) the state of the data file. There are some fields to explain:

Blocks: Number of data blocks occupied by data files

Autoextensible: Whether data files allow extensions

Tablespace_name: Table space name for data file

Control File: is a binary file that describes the physical structure of the database. It mainly stores data files and log file information in the database. If the control file is corrupted during the use of Oracle, the database will not function correctly.

Oracle typically creates 3 control files that contain the same information by default, so that when one is compromised, other control files can be called to continue working.

log file: A file that records the information that is modified in the database, guarantees the security of the database, and enables the backup and recovery of the data.

If the status bit current table name System is using the corresponding log file for that field. If it is inactive, it is not used.

When the space of one log filegroup is exhausted, the Oracle system automatically transitions to another log filegroup. However, you can also use the ALTER system SWITHCH logfile for manual switching .

Other Files

Of course, there are some other documents besides the above.

parameter file : Logs basic information about the Oracle database, such as the database name and the path where the control file resides.

Backup files: Backup files can be used to back up damaged files

Archive redo log files : Copy and save a log file that is full

warning, trace log files : If a process finds an internal error, it can store information about the error in its trace file.

two. Logical storage Structure

The table space for an Oracle database, from a logical storage structure, includes table spaces, segments, extents, and data fast. The relationship between them is a multi-database composed of a section, a plurality of sections composed of one segment, multiple segments form a table space, multiple table spaces constitute a database, so the figure is as follows:

① tablespace: Oralce, the largest logical storage structure is table space (tablespace). The table space corresponds to the physical data file. Detailed below. The ② segment (Segment) is a set of extents that comprise a database object, such as a table or index, that is treated by Oracle as a unit . Therefore, the segment is the smallest unit that the database end user will process.

Divided into 5 middle:

Data Segment : Stores the data in the table.

Index Segment: stores all indexes in the table.

Temporary segment : stores temporary data.

LOB segment : Used to store large data objects in a table.

Fallback segment: used to store values before the user data is modified.

③ Zone: In Oracle, the zone is the smallest unit of disk space allocation.

The increase of the segment is achieved by increasing the number of zones, and the number is not unlimited. When creating segments, you can use Min_extents and max_extents to define the number of extents.

The ④ block is the most basic unit for managing storage space and the smallest logical storage unit.

When you create an Oracle database, the initialization parameter db_block_size is used to specify the size of a database. after the database is created, you cannot modify the size of the database . Like what:

The structure of the data block is as follows:

Block Header: A moving information in the database, such as the physical address of the database.

Table Directory: Stores information for a table.

Row directory: Stores valid row information in the database.

Free space: storage space that is not yet in use.

Row space: Data that stores tables or indexes.

Three. Memory structure

When a user issues an SQL command, the server process parses the SQL statement and executes it, then reads the data that the user needs from the disk's data file and stores it in a data buffer in the system's global zone. If the user process modifies the data in the buffer, the modified data is written by the database to the process dbwn The hill disk data file.

Depending on how the system uses memory, the memory of the Oracle database is divided into the following sections:

① system Global Area (SGA)

is a set of shared memory structures shared by the Oracle bit system that can protect data or control information for a data instance. The system global zone can be divided into the following functions:

    • Data buffers

Used to store data read from a disk data file for all users to share.

    • Log buffers

      The modification operation information used to store the database.

    • Shared pool

The shared pool is used to hold the most recently executed SQL statement, the data dictionary information of the PL/SQL program, which is an area of memory for parsing, compiling, and performing syntax parsing, and compilation, and execution of the statements.

The size of the shared pool is determined by shared_pool_size.

② Program Global AREA,PGA

is an area of memory that contains individual user or server data and control information that is automatically assigned by Oracle when a user process connects to the Oracle database and creates a session.

③ Sorting Zone (sort area)

Is the memory space provided by the Oracle system for temporary data generated by the sort operation.

④ Pond (Large Pool)

Provides a large buffer for use by backup and restore operations of the database.

Four. Instance process structure

The ①DBWN (database write) process is a background process that assigns a management data buffer to write data in a buffer to a data file.

The ②LGWR (log write, Journal write) process is an acquired process that is responsible for managing the log buffers, which is used to write log data from the log buffer to the disk's log file.

The ③ckpt (Check point) process saves all the data in the modified data buffer to be written to the disk data file.

The default is 1800 seconds.

④smon (System Monitor) process: Used to perform instance recovery when an instance is started and to clean up temporary segments that are not in use.

⑤pmon (Process Monitor) session: Used to perform recovery operations when a user process fails.

⑥ARCN (Archive Process, archive): Copies the full log file to the archive log file.

⑦reco (Recovery) process: Used in distributed database system, to automatically solve the problem of things in the distributed database.

⑧LCKN (Lock) process: exists in a parallel server system to enable blocking between multiple instances.

⑨DNNN (Dispatchers) process: exists in a multithreaded server architecture to connect user processes to a server process.

Five. Data dictionary

In this and previous article I used a lot of data dictionaries (where Oracle databases are used to store database structure information). This is very useful, there are many online information! ~~

Oracle's Data dictionary-----Brad Miller

Reprinted from: http://www.cnblogs.com/damonlan/archive/2012/07/27/2604132.html

Oracle's architecture

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.