Process Structure of Oracle architecture Trilogy

Source: Internet
Author: User
Tags dedicated server
Oracle-related processes can be divided into user processes and oracle processes. Oracle processes can be divided into server processes and background processes. Server processes can be divided into dedicated server processes and sharing

Oracle-related processes can be divided into user processes and oracle processes. Oracle processes can be divided into server processes and background processes. Server processes can be divided into dedicated server processes and sharing

Oracle-related processes can be divided into user processes and oracle processes. Oracle processes can be divided into server processes and background processes. Server processes can be divided into dedicated server processes and Shared Server Processes. Background processes can be divided into DBWn, LGWR, and CKPT.

Concepts related to user processes: Connection and session
Connection and session are two different concepts. You can create 0, 1, or more sessions on one connection, and each session is independent and independent. A connection is a process.
For example:
SQL> set autotrace on
SQL> select sid from v $ session where username = USER;

SID
----------
146
158
159
The above connection has three sessions.
Connection: A physical path between the user process and the instance.
Session: a logical entity in the instance.
Therefore, it is physically a connection and logically a session.
There are two commands with bad names:
Connect: it should be called session Creation
Disconnect: ends all sessions.
With SQL * plus, the command to disconnect is: exit

A server process is a process that completes the work on behalf of a customer session. They work hard, and almost all work is done by them. Therefore, they occupy the most cpu time.
1) Parse and execute SQL statements
2) If the required data is not in sga, server process will read it to the database _ buffer_cache of sga on the disk.
3) return the result to the application

Query the server process and user process pid for a single session:
SQL> select a. spid "dedicated server process", B. process "customer process"
From v $ process a, v $ session B
Where a. addr = B. paddr
And B. sid = (select sid from v $ mystat where rownum = 1) 2 3 4
5/

Dedicated server into customer Process
------------------------
8313 8304

SQL>! Ps-p 8313 8304
PID TTY STAT TIME COMMAND
8304 pts/2 S + sqlplus
8313? Ss 0: 00 oracleorcl (DESCRIPTION = (LOCAL = YES) (ADDRESS = (PROTOCOL

Background processes are all from the same binary executable program oracle (/u01/app/oracle/product/10.2.0/db_1/bin/), which can be queried from v $ bgprocess.
PMON
1) Clear abnormal connections, such as rolling back uncommitted transactions and releasing resources.
2) monitor all oracle processes. If the process fails, the process may be restarted or the instance may be terminated (LGWR failure)
3) register the instance with the listener and communicate with it.
[Roll back uncommitted transactions: oracle server performs operations based on server process, while server process performs operations based on user process. If the user process is interrupted, the server process will have a blind wait. In this case, PMON checks whether the user process corresponding to the server process is interrupted. If yes, roll back the transaction.]

SMON
1) instance recovery: Write the data protected in the online redo log file back to the data file
2) Collection space: Merge idle Space

CKPT
The checkpoint process does not really create a checkpoint as its name implies. Creating a checkpoint is mainly a task of DBWn. CKPT only sends a request to write the dirty block in database_buffer_cache to the data file, and the person who responds to this call is DBWn. After DBWn completes the checkpoint it created (the checkpoint here refers to DBWn checking whether some redo entries are written into the online redo log file, then write the data protected by redo log file into the data file. This is called a checkpoint event). CKPT will record the data file header in the control file and data file. The relationship between the two is like Zhuge Liang and Guan Yu. CKPT is Zhuge Liang, DBWn is Guan Yu, And Zhuge Liang asks to attack Qilian Mountains. When he sends this military order, Guan Yu will take troops to attack, after occupying Qilian Mountains, Zhuge Liang will do some subsequent work.

DBWn
DBWn is used to release the buffer or post logs. Maintains the consistency between oracle memory data and disk data.
To improve DBWn write performance, we recommend that you use a platform that supports asynchronous I/O. When asynchronous I/O is used, DBWn will collect the blocks to be written and hand them over to the OS. However, instead of waiting for the OS to write the blocks to the disk, DBWn will immediately return and collect the next batch of blocks to be written, when the OS completes the write operation, it asynchronously notifies DBWn. In addition, DBWn is a distributed write, and LGWR is a sequential write, which is much slower than sequential write. This is also the main reason why oracle uses LGWR and redo log files. The number of dbwn and the number of cpu are usually the same.

LGWR
Oracle has a fast Submission mechanism, that is, when a user submits a redo entry, the redo entry is put into the redo log buffer by the server process, LGWR will soon write these log entries from the log buffer to online redo log files. However, the modified data is not immediately written to the data file on the disk, but is delayed.
When a transaction is committed, an SCN is assigned, which is written to the online redo log file along with the redo entry.

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.