Oracle has its own file structure, Buffer structure, process structure, and its own optimization functions.
The Oracle server consists of an Oracle database and an Oracle instance. That is to say, our Oracle database is only a collection of data files and related database management systems, and Oracle instances are actually providing services for users. The memory structure of an Oracle instance is mainly contained in the memory Area of the System Global Area (SGA: System Global Area). SGA can be shared by all user processes.
· Oracle Server Memory Structure:
The Oracle server has two memory structures: system global zone (SGA) and program global zone (PGA)
The global zone of the system is a group of shared memory structures that store the control information of an Oracle database instance and the data of each shared user. The global zone of the program is the memory zone allocated by the Oracle server process to connect to the database and create sessions for the current user session, stores information related to SQL statement execution during the user's connection. This region is private.
· Process Structure of the Oracle server:
The processes in the Oracle database system can be divided into user processes and server-side processes. server-side processes are divided into server processes and backend processes.
A user process works on a client and sends a request to the server process. SQL * Plus and Oracle Forms Builder are all user processes.
The server process receives user requests and communicates with the database (through SGA) based on the requests. Through these communications, the user process processes the data in the database, the specific operations such as data reading and writing and log writing are completed by the background process.
Backend processes on the server: including DBWn, LGWR, ARCn, CKPT, and SMON) and process monitoring process (PMON.
1. DataBase Writer (DBWn): writes changed data blocks from memory to actual data files. By default, only one database write process is started when the database instance is started, that is, DBW0. You can set up to 20 initialization parameters DB_WRITER_PROCESSES (numbers are 0-9 and a-j) the write process of the database to perform the write operation. To achieve highly dynamic database performance. There are only two processes in the Oracle database system that can write data files: the database write process and the checkpoint process.
2. Log Writer (LGWR): writes the content in the redo Log buffer to the redo Log. Redo logs are copies of all transactions in the database. The purpose of this operation is to enable Oracle to reply from different errors. The log writing process is the only process that can read and write redo logs.
3. Archive Process (ARCn): Copies the transaction changes of the redo log to the Archive log file. Redo transaction logs are recorded in sequence. After a log file is filled, the log switch is used to switch to another available redo transaction log. This background process is only valid in ARCHIVELOG mode. By default, there are only two archived logs (ARC0 and ARC1). You can define up to 30 log archiving processes by initializing the LOG_ARCHIVE_MAX_PROCESSES parameter. Generally, DBAs do not need to be set. The log writing process (LGWR) automatically starts an appropriate number of archiving processes based on the needs of archiving tasks.
4. Checkpoint Process (CKPT): it is used to issue a Checkpoint to synchronize database data files, control files, and redo logs. Generally speaking, after a checkpoint is issued, both the database write process and the log write process write the cached data to the corresponding data file and redo log, this ensures consistency between data files, control files, and redo log files.
5. System Monitor (SMON): It is a mandatory process for recovery when the database System is started. It is responsible for many internal operations. It is used to restore database instances, release control fragments, and release temporary segments. That is, the current database system is shut down abnormally and the restoration work is performed when it is started again. In parallel server mode, the system monitoring process can restore the database that fails on another computer.
6. Process Monitor (PMON): monitors the execution of server processes and makes it clear when server processes fail. A process monitoring process is a mandatory process for database users who fail to recover.
7. Lock process (LCKn): Used in Parallel Server mode to help database communication.
8. scheduling process (Dnnn): when a multi-threaded server is used, it is responsible for routing requests from the user processes connected to the available server processes, and return the response to the user process.
9. Job Queue process (Jnnn): Job Queue process and Job Queue monitoring process. 10 Gb Introduction
10. Flash Recovery process (Recovery Writer, RVER): 9i proposes a 10 GB flash Recovery technology. Flash back to the database is a new method for restoring time points. It can quickly restore the Oracle database to a previous time point to correct any problems caused by logical data corruption or user errors. When recovery is required, the flash recovery process can restore the database to the time point before the error and only recover the changed data blocks.
After the database is started, you can view the started background process in the system dynamic performance monitoring view v $ bgprocess. The query code is as follows:
Conn/@ orcl as sysdba -- log on as an administrator
Column description format A30 -- set the query column Display format
Set pagesize 200 -- set the number of entries displayed on a single page
Select paddr, pserial #, name, description from v $ bgprocess order by name
· Server process structure mode:
The process structure mode of the Oracle server determines how the system responds to user process requests.
1. dedicated server mode: in dedicated server mode, Oracle starts a special front-end service process for each client process connected to the database instance, the front-end service process of a customer process only performs database access operations for its customer processes.
The dedicated server mode is generally used only for intensive batch operations, so that the server process remains busy for most of the time. When the total number of client connections is expected to be small, or the client sends requests to the server for a long time, the dedicated server mode should be used. The C/S architecture application system developed in the LAN environment adopts the dedicated server mode for better performance.
2. Shared Server Mode: multi-thread server mode is a typical process structure used by Oracle to support customer connection. These server-side processes can effectively support a large number of user groups. Its components include the scheduler, shared server process, and queue ).
Multi-threaded server configuration is very effective for a typical multi-user application environment. A few sharing server processes perform a lot of data access operations to connect customers, and a large number of user groups can be satisfied with a small amount of process overhead.
When using the Shared Server mode, you must specify the number of server processes that need to be created when starting the database instance. You can set this parameter through the SHARED_SERVERS initialization parameter.
This article is from the "IT thin" blog