Oracle database architecture

Source: Internet
Author: User

Oracle DatabaseOfArchitectureIt includes four aspects: the physical structure, logical structure, memory structure and process of the database. Oracle Database is a highly functional relational database management system. It is the preferred database for many businesses because it is easy to operate and fast to operate, the following describes the architecture of Oracle databases.

1. Physical Structure

The structure of a physical database is determined by the operating system files that constitute the database. The Oracle database files include:

Data File)

Data files are used to store all the data in the database. For example, the data in the database table and the index data are generally in the *. dbf format, for example, userCIMS. dbf.

Log File Redo Log File)

The log file is used to record all changes made by the database, such as adding, deleting, and modifying.) in this way, you can use the log file to recover the database in case of a system failure. The name is usually in Log *. dbf format, for example, Log1CIMS. dbf and Log2CIMS. dbf.

Control File)

Each Oracle database has corresponding control files, which are smaller binary files used to record the physical structure of the database, such: database Name, database data file, and log file name and location. Used to open and access databases. The name is usually in Ctrl * ctl format, for example, Ctrl1CIMS. ctl.

Configuration File

The configuration file records important parameters during Oracle database running, such as the data block size and memory structure configuration. The name is usually in the init *. ora format, for example, initCIMS. ora.

2. Logical Structure

The logical structure of the Oracle database describes how the database logically stores data in the database. The logical structure includes the tablespace, segment, partition, data block, and mode object. The logical structure of a database determines how a database uses the physical space of the system. The schema object and its Relationship between them describe the design between relational databases.

Logically, a database is composed of one or more tablespaces. A tablespace is a data warehouse that is physically grouped in the database. Each tablespace is composed of segments, A segment is composed of a group of zones (extent), and a zone is composed of a group of consecutive database blocks, A database block corresponds to one or more physical blocks on the hard disk. A tablespace stores physical files of one or more databases, that is, data files. The data in a database is logically stored in the tablespace.

Table space)

The Oracle database is divided into one or more logical structures called tablespaces, which include two types of tablespaces: System tablespaces and non-System tablespaces. The System tablespaces are automatically created when the database is installed, it contains all the data dictionaries of the database, definitions of stored procedures, packages, functions and triggers, and system rollback segments. In addition, it can contain user data ..

A tablespace contains many segments, each of which may be discontinuous. Each partition is composed of a group of continuous data blocks, which are the smallest unit for database operations.

Each tablespace corresponds to one or more data files. Each data file can belong to only one tablespace.

Database block)

A database block is also called a logical block or an ORACLE block. It corresponds to one or more physical blocks on the disk. Its size is determined by the initial parameter db-block-size in the file init. in ora), the typical size is 2 k. The Pckfree and pctused parameters are used to optimize the use of data block space.

Area extent)

A zone is the logical unit for allocating database buckets consisting of a group of consecutive data blocks.

Segment)

A segment is a collection of one or more non-consecutive zones. It contains all data in a specific logical structure in a tablespace. segments cannot be stored across tablespaces. Oracle databases include data segments, index segments, temporary segments, and rollback segments.

Schema object)

The schema objects of Oracle databases include tables, views, sequences, consent words, indexes, triggers, and stored procedures. The schema objects are described in the following sections.

3. Oracle Server system process and Memory Structure

After the Oracle database is started on the computer server, an Oracle Instance is started on the server ). An ORACLE Instance is a software mechanism used to access and control databases. It consists of the global SGA of the system and the ORACLE process. SGA is a group of shared memory buffers allocated by the system for instances. It is used to store database instances and control information for data management and operations in the database.

Process is an extremely important concept in the operating system. A process executes a group of operations to complete a specific task. For the ORACLE database management system, processes are composed of user processes, server processes, and background processes.

When a user runs an application, the system creates a user process for it. The server process processes the requests of the user processes connected to it. It communicates with the user process and serves the ORACLE request of the connected user process.

To improve system performance and better implement multi-user functions, ORACLE also starts some background processes in the system background for database data operations.

The background processes of system processes mainly include:

SMON system monitoring process: system monitor) is responsible for automatic instance recovery and recovery classification sort) tablespace.

PMON PRocess monitoring PRocess: PRocess monitor) enables the user PRocess to recover from faults, clear the memory zone, and release the resources required by the PRocess.

DBWR database write process: the governance process of the database buffer.

Under its governance, the database buffer always maintains a certain number of free buffer blocks to ensure that user processes can always find free buffer blocks for their use.

LGWR Log File writing process: it is the governance process of the log buffer, and is responsible for writing the log items in the log buffer to the log files on the disk. Each instance has only one LGWR process.

ARCH archive process: archiver process) copies an existing online log file to a specified storage device. ARCH is performed only when the log file group switch is enabled. ARCH is not required, but is issued only when automatic archiving is available or when manual archiving requests are made.

RECO recovery process: a process used when distributed options are available. It is mainly used to resolve faults that occur when distributed transactions are referenced. It can only appear in systems that promise distributed transactions.

LCKn blocking process: used for Parallel Server systems, mainly to block instances.

Memory Structure SGA)

SGA is a group of shared memory buffers allocated by Oracle for an instance. It contains the data and control information of the instance. SGA is automatically allocated when the instance is started, and is withdrawn when the instance is closed. All database data operations must be performed through SGA.

Buffer Cache: stores copies of database blocks in the database. It is composed of a group of buffer blocks, which are shared by all user processes linked to the instance. The number of buffer blocks is determined by the initialization parameter DB_BLOCK_BUFFERS. The size of the buffer block is determined by the initialization parameter DB_BLOCK_SIZE. Large data blocks increase the query speed. It is operated by DBWR.

B. Log Buffer Redo Log Buffer: stores data operation changes. They are stored in the log buffer in the form of a log item redo entry. When you need to recover the database, log entries are used to reconstruct or roll back the changes made to the database. The size of the log buffer is determined by the initialization parameter LOG_BUFFER. A large log buffer can reduce the number of log file I/O times. The background process LGWR writes the information in the log buffer to the log file on the disk. You can start the ARCH background process to archive the log information.

C. Shared Pool: Contains SQL statement information for processing. It includes the shared SQL area and data dictionary storage area. The shared SQL area contains the information used to execute specific SQL statements. The data dictionary area is used to store data dictionaries, which are shared by all user processes.

Cursors: memory pointer for executing SQL statements to be processed

Other information areas: In addition to the above information areas, there are also some communication information between processes, such as blocking information). In the multi-clue server configuration, there are some information about the global area of the program, request queue and response queue.

We will introduce the architecture of the Oracle database here. I hope you will have a deeper understanding of the Oracle database after the above learning. Finally, I hope everyone will be able to get some gains from the content mentioned above.

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.