Oracle Process summary (including query process, DML execution, dbwn write disk process)

Source: Internet
Author: User
Tags sessions


1 Query Process

1 The process first checks the memory and the database cache area to see if there is a block of data that is needed. If it does not exist, proceed to step 2nd, and if it exists, proceed to step 4th.

2 If the query is started, the data block to be queried is changed and the system will locate the data block in the Undo section that protects the change, and if there is no change, the system locates the corresponding data block. Proceed to step 3rd.

3 The server process replicates these blocks of data to the free buffer in the database cache area based on the LRU algorithm (least recently used), while the address of the dirty buffers found during the LRU is moved to the checkpoint queue.

4 including sorting and further processing within the cluster will be completed in the PGA of the specified session for step 5th.

5 Returns the result set of the query to the user.


2 DML Execution Process

1 The process first checks the memory and the database cache area to see if there is a block of data that is needed. If it does not exist, proceed to step 2nd, and if it exists, proceed to step 4th.

2 If the query is started, the data block to be queried is changed and the system will locate the data block in the Undo section that protects the change, and if there is no change, the system locates the corresponding data block. Proceed to step 3rd.

3 The server process replicates these blocks of data to the free buffer in the database cache area based on the LRU algorithm (least recently used), while the address of the dirty buffers found during the LRU is moved to the checkpoint queue. If the time to look for an idle buffer is too long, the DBWN process is required to write a buffer in the checkpoint queue to the hard disk. Freeing up a portion of the free buffer.

4 including sorting and further processing within the cluster will be completed in the PGA of the specified session for step 5th.

5 an empty block of data (or expired data block) for the revocation section

6 placing exclusive locks on all records and key keys affected by the DML operation (preventing other sessions from changing the same record), placing shared locks on the tables containing those records (guaranteed that the table's structure will not change during DML)

7 build redo, that is, the server process will specify the data block changes (including the old value before the change, the new value after the change, if there is an associated index, but also include the old value of the index and the new value) write to the log buffer

8 in the Database cache area, using the changed column to update the table block, the old value to write the Undo segment data Block (at this point until the commit, other sessions on the value of the query, the value index of the query will be positioned to the corresponding undo segment)

9 The commit phase, LGWR writes the contents of the log buffer to the disk, and the DBWN process does not perform any action.

10) Lifting the 6th step of the lock.


3 Dbwn The process of writing a disk

1 The server process finds an idle buffer for too long, the DBWN process is required to write a dirty buffer in the checkpoint queue to the hard disk, which then becomes an idle buffer.

2 The checkpoint queue becomes too long, and the DBWN process is required to write a dirty buffer in the checkpoint queue to the hard disk, which then becomes an idle buffer.

3 for a static database, Dbwn traverses the LRU list every 3 seconds and writes the first few dirty buffers not recently used to the hard drive.

4 log switching does not trigger the checkpoint process.

5 When the database checkpoint process occurs, all dirty buffers are written to disk through 1 actions

sql> alter system checkpoint

6 The following operations can write all the dirty buffers of a table space to disk

A) Delete tablespace

b) Make tablespace read-only

(c) Placing the tablespace into hot standby mode

d) Take tablespaces offline


4  Start Process Click to view Oracle Startup & SHUTDOWN ( http:// blog.csdn.net/u011847917/article/details/10476023 )

5  Close the procedure click to view Oracle STARTUP & SHUTDOWN
(http://blog.csdn.net/u011847917/ article/details/10476023)

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.