1、1 耿 祥 义 .JSP 基 础 教 程 .北 京 :清 华 大 学 出 版社 ,2009.10 附录 英文原文 Analysis of Oracle database background process function 1.DBWR process: the process of the implementation of the buffer is written to the data file, is responsible for the buffer memory management in a Oracle background process. When a buffer
2、buffer is modified, it is marked as dirty, DBWR is the main task of dirty buffer is written to disk, so that the buffer to maintain clean. Because the buffer memory buffer in the database or user process dirty, unused buffer to reduce the number of. When the unused buffer down to little, so that use
3、r processes from disk into memory block to store could not find unused buffer, DBWR will manage buffer storage, the user process always available unused buffer. Oracle uses LRU ( LEAST RECENTLY USED ) algorithm ( LRU ) keep the memory data block is a recently used, so that the I/O minimum. In the fo
4、llowing case indicates that DBWR will dirty buffers to disk: When a server process will be a buffer into the dirty table, the dirty expression to the critical length, the service will notify DBWR writing. The critical length for the value of the parameter DB-BLOCK-WRITE-BATCH half. When a server pro
5、cess in a LRU look-up table in DB-BLOCK-MAX-SCAN-CNT buffer, did not find unused buffer, it stops to find and notify the DBWR to write. Timeout ( every3 seconds ), DBWR will inform itself. When a checkpoint, LGWR will inform DBWR.of the first two cases, DBWR will dirty table block is written to disk
6、, each can write blocks by the initialization parameter DB-BLOCK- specified by WRITE-BATCH. If the dirty list without this parameter specifies the number of buffer, DBWR from the LUR table to find another dirty buffer. If the DBWR in three inactive, a time-out occurs. In this case the DBWR on the LR
7、U table to find the specified number of buffer, to find any dirty buffers to disk. Whenever a timeout occurs, DBWR finds a new buffer group. Each time by the DBWR to find the number of buffers for sleep parameter DB-BLOCK- WRITE-BATCH values two times. If the database is idle, DBWR will eventually a
8、ll buffer storage to disk. In the occurs check point, LGWR specifies a modified buffer table must be written to disk. DBWR the specified buffer is written to disk. On some platforms, one instance can have multiple DBWR. in this instance, some blocks can be written to a disk, some other piece can be
9、written to other disk. The parameter DB-WRITERS control of DBWR process number. 2. LGWR process: the process will log buffer is written to disk in a log file, it is responsible for the management of log buffer of a Oracle background process. LGWR process will since the last written to disk since all
10、 log entries for output, the output of the LGWR: When a user process to submit a written when a commit record transaction. Every three seconds will log buffer output. When the log buffer1/3 is full when the log buffer output. When DBWR will modify the buffer is written to disk when the log buffer ou
11、tput. The LGWR process synchronous writes to the active mirror online log file group. If the group a file to be deleted or not available, LGWR can continue to write to the group and other documents. Log buffer is a circular buffer. When the LGWR log buffer log entries are written to the log file, th
12、e server process can be a new log entry is written to the log buffer. LGWR used to write very quickly, can ensure that the log buffer total space can be written into the new log entries. Note: sometimes when we need more log buffer, LWGR in a transaction log entries before will write log entries, and these only when in the future after the transaction commits to permanent. ORACLE uses fast delivery mechanism, when the user issues a COMMIT