The process structure of the oracle architecture trilogy and 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. The concepts related to user processes are: 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; www.2cto.com SID ---------- 146 158 159 and above, there are three sessions on this connection. 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 bad commands: connect: Create session disconnect: end all sessions. With SQL * plus, the real command to disconnect is: exit the server process is the process that represents the customer session to complete the work. They work hard, and almost all work is done by them. Therefore, they occupy the most cpu time. 1) Parse and execute the SQL statement. 2) if the required data is not in sga, server process will read it to database_buffer_cache of sga on the disk. 3) return the result to a single session of the application to query the server process and user process pid: SQL> select. spid "dedicated server process", B. process "customer process" from v $ process a, v $ session B where. addr = B. paddr and B. sid = (select sid from v $ mystat where rownum = 1) 2 3 4 5/The dedicated server enters the client process ---------- ------------ 8313 8304 www.2cto.com SQL>! Ps-p 8313 8304 pid tty stat time command 8304 pts/2 S + 0: 00 sqlplus 8313? Ss 0: 00 oracleorcl (DESCRIPTION = (LOCAL = YES) (ADDRESS = (all PROTOCOL background processes come from the same binary executable program oracle (/u01/app/oracle/product/10.2.0/db_1/bin /), it 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, restart the process, it is also possible to terminate the instance (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: The CKPT Checkpoint Process in the merged idle space 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. The action of www.2cto.com DBWn is 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. Author: linwaterbin