DBWR process: This process writes a buffer into a data file. It is an Oracle background process responsible for Buffer Storage zone management. When a buffer in the buffer zone is modified, it is marked as "dirty". The main task of DBWR is to write the "dirty" buffer to the disk to keep the buffer clean ". The number of unused buffers is reduced because the buffer zone is filled in the database or the user process is dirty. When unused buffers are dropped to a very small level, and user processes cannot find unused buffers when they want to read blocks from the disk to the memory storage area, DBWR manages the buffer areas, allows user processes to get unused buffers.
Oracle uses the LRU (least recently used) algorithm (the least recently used algorithm) to keep data blocks in memory recently used, minimizing I/O. In the following cases, DBWR needs to write dirty buffers to the disk:
When a server process moves a buffer into the dirty table, the dirty expression is critical, the service process will notify DBWR to write. The critical length is half the value of the parameter DB-BLOCK-WRITE-BATCH.
When a server process looks for the DB-BLOCK-MAX-SCAN-CNT buffer in the LRU table, there is no unused buffer, it stops searching and notifies DBWR to write. If a timeout occurs (3 seconds each time), DBWR notifies itself. When a checkpoint occurs, LGWR notifies DBWR. In the first two cases, DBWR dirty blocks in the table are written to the disk, with each writable block specified by the initialization parameter DB-BLOCK-WRITE-BATCH. If the dirty table does not have a buffer with the specified number of blocks, DBWR looks for another dirty buffer from the LUR table.
If DBWR is not active within three seconds, a timeout occurs. In this case, DBWR searches for a specified number of buffers for the LRU table and writes any dirty buffers to the disk. When timeout occurs, DBWR searches for a new buffer group. The number of buffers each time searched by DBWR is twice the value of the sleep parameter DB-BLOCK-WRITE-BATCH. If the database is transferred by air, DBWR eventually writes all the buffer zones to the disk.
When a Check Point occurs, LGWR specifies that a buffer table must be written to the disk. DBWR writes the specified buffer to the disk.
| [Content navigation] |
| Page 1st: Functional Analysis of Oracle Database background processes |
Page 2nd: Functional Analysis of Oracle Database background processes |
| Page 3rd: Functional Analysis of Oracle Database background processes |
|