Oracle Architecture Chapter2

Source: Internet
Author: User

Oracle architecture refers to the Oracle server architecture , the database server mainly consists of three parts to manage the database of various software tools (Sqlplus,oem, etc.), instance ( a set of Oracle background processes and shared memory regions allocated on the server ), a database ( a collection of various disk-based physical files, such as data files, control files, log files, parameter files, archived log files ), and the relationships between the databases ( An instance is used to manage and control a database, a database provides data for an instance, a database can be reprinted and opened by multiple instances, and an instance can only be reproduced and opened in a database during its lifetime )

1. Database

1.1 Database composition from logical angle--table space, segment, data area, data block, user-oriented partition method

tablespace: The largest logical partition of the database, which can hold data tables, indexes, rollback segments, and so on, any data object must have the specified tablespace table space and data file relationship when it is created. A tablespace consists of one or more data files that belong to a single table space, and the storage space for Oracle data is logically represented as a tablespace, physically represented as a data file (table space equivalent to a folder)

Category: System tablespace (storing internal tables and data dictionary data)

Syaaux table space, secondary tablespace of system table space, reducing load on systems table space, storing data objects other than dictionaries

Undo table space, storing revocation information

USER tablespace: Holds data objects for creation, such as Scott, where data from different application systems should be stored in different table spaces, while different table spaces should be stored on different disks, reducing I/O collisions and making more use of the system's operational performance.

Segment: It is not an allocation unit of storage space, but an independent logical storage structure for storing tables, indexes, etc., a data segment belongs to only one specific data object, the data area within the segment can be discontinuous, and spans multiple files,

Data area: data area is composed of contiguous blocks of data, the data area is the smallest unit of storage allocation, the allocation of storage space is in the data area, the purpose of the data area is to save data of a specific data type, an Oracle object contains at least one data area

Data block: the smallest logical unit in a logical storage structure and the smallest storage unit for performing database input and output operations. Chunks of data block, table directory, row directory composed of block, the entire data blocks to hold the boot information, free space is unused information for data insertion and update, row data storage table data and index

1.2 Physical storage structure

The logical data is stored in a tablespace, and physically stored in a table space contains physical files, physical storage structure refers to a variety of physical files, mainly data files, control files, redo log files, archive files, parameter files, password files and warning log files

Data files

When you create a data object in a tablespace, the user cannot decide which data file to use for storage, and the Oracle system is responsible for allocating the physical storage space. A data object can be stored in a single data file, or it can be distributed across multiple data files in the same table space . Read data is the Oracle system stores data in the data file in the buffer zone, if the user requests the data is no longer the buffer zone, the data file to read to the buffer, the data update is not immediately stored in the data file , but by the background process DBWR decide when to write to the file, Reduce the I/O operation of the disk and improve the response performance of the system. (System data file, revoke data file, user data file)

Control files

The control file is a binary file that records the physical structure of the database, including the database name, the name and location of the database file and log file, the date the database was established, the system change number, the checkpoint, the status of the archive, and so on. It is typically created when the Oracle system is installed or when the database is created, and the location of the control file is determined by the Control_files parameter value of the server parameter file Spfileorcl.ora. When the Oracle instance starts, it first accesses the initialization parameter file SPFile and allocates memory for the system global Zone (SGA), when the instance is installed and the control file is open, and Oracle automatically reads the control file. If it is normal to read all the data files and log files for user access, if the control file information error, will not start the instance normally. To prevent control file corruption, the system will have two to three identical control files that record the same information.

Log files-redo logs and archive logs

The function of the log file is to record changes made to the data, and if there is a problem with the data, the original data can be modified by the log file.

redo log files: when the user submits the commit command, the database first logs the action in the log file, so the log file records all the changes that occurred in the database. When the tablespace is set to nologging, no log information is generated, but this destroys the integrity of the log, which consists of a number of log groups, each consisting of one or more log files. The log information is initially stored in the Redo log buffer, which is written to the log file by the LGWR process when the information reaches One-third.

Archive log files: when all log files are written again, the process will turn to the first log group again, to avoid overwriting the log information and to address the issue by filing. In the archive operation, the log write process (ARCH) needs to be archived before it can overwrite the log, delay system response time, and the archive consumes a lot of disk space, affecting overall performance, so Oracle does not use the archive mode by default.

Server parameter file (SPFILE):

SPFILE is a binary file, used to record the basic parameters of the database information (such as the database name, the path of the control file, the size of the log buffer, the size of the data block, etc.), before starting the database, the system will read the SPFILE initialization parameter configuration and launch instance, SPFILE Automatically created by the system named Spfilesid.ora, the SID is the database instance name that is created, SPFILE is maintained by the system, and as far as possible does not edit the file directly, but can be modified by the Enterprise Manager (OEM) or alter SYSTEM command, so that parameters are automatically written into the file.

password file: The password file is used to verify the SYSDBA permissions of the binary file, the password file naming format is generally pwd<sid>, after you create the password file, you can use the Remote_login_passwordfile To control the use status of the password file: NONE means that only a single instance of the database can be validated by the operating system, and shared means that multiple DB instances can use this password validation, EXCLUSIVE

Warning file

A text file (Alter_orcl.log) that is stored in the Oracle system when the warning file is used to record the operating information and error messages of the system

Trace file

Trace file includes background process trace file and user process trace file, file naming format is generally <SID>_<PROCESSNAME>_<SPID>.TRC

2. Example

An instance is a set of shared memory regions that are allocated in the Oracle backend and server. Through the instance to access and control the disk data files, when the user connected to the database is actually connected to the database instance, with the database server to manage and manipulate the database,

In fact, as an intermediary hub, responsible for database and database server traffic.

2.1 system Global Zone (SGA shared memory Area ): Resources in the SGA can be used by multiple users, and the SGA consists mainly of memory structures such as buffer zones, shared pools, redo log buffers, Java pools, and large pools. The SGA is loaded into memory as the instance of the database is started and the SGA area disappears when the database is closed

2.1.1 High-speed data buffer: generally store the most recently used data, divided into three parts of the dirty data area (has been modified, waiting to delete or write into the data file data), the idle area (does not contain any data), Reserved area (data that is being used by the user or is explicitly reserved for future use)

2.1.2 Redo Log buffer: used to hold the log information generated when the database operation, when the checkpoint occurred or redo log buffer information reached a certain peak, there is LGWR written to the redo log file. Therefore, the large redo log buffer can reduce the number of I/O read and write times of redo log files, and have some effect on the overall performance of the data.

2. 1.3 Shared Pool

The shared pool is an area of memory that is reserved for the SGA, and is used for caching SQL statements, the PL + statements, data dictionaries, resource locks, character sets, and other control structures, and the shared pool contains library cache buffers (SQL. ) and dictionary cache area (data dictionary:)

2.1.4 Large Pool

Daxing pool is not a must-have memory structure for the SGA, the instance requires a large pool that is used to mitigate the access pressure of the shared pool, for example, when data is backed up or restored or when the asynchronous I/O function is emulated as I/O buffers. When you perform a large number of sort operations, parallel queries

2.1.5 Flow Pool

For information sharing between databases

2.1.6 Java Pool

Memory area for Java virtual machines, support for running Java packages in the database

2.1.7 Background Process

A background process is an important part of an instance. where Smon (System monitoring process), PMOM (process monitoring process), DBWR (data writer), CKPT (checkpoint process), these 5 background processes must start normally, otherwise it will cause a crash of the DB instance. Other LGWR (log write process), ARCH (archive process), LCKN (lock process), RECO (recovery process), dnnn (scheduling process), SNNP (snapshot process)

3. Various software for managing databases--foreground process

3.1 Program Global Zone (PGA) (non-shared memory area)

The program global zone can also be called the user process global zone, his memory area is private, a server process, only access to its own portion of the PGA resources, each server resource sum is the PGA size of the instance.

foreground process: A user process (an application capable of producing or executing SQL statements, such as Sql*plus, for example, a session is an interaction that occurs after a user process and an instance are connected, a general user makes a request, and a database instance returns a response message for the user)

The server process (the SQL statement or Sql*plus command issued by the user to the DB instance during the parsing session, and for the private server mode, the client process and the Oracle server process are one by one corresponding, while in shared server mode, An Oracle server process may serve multiple client processes at the same time)

Common Data Dictionary references http://www.cnblogs.com/liuguosong/p/5808642.html

Oracle Architecture Chapter2

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.