DBWR—the Database Writer

The Database Writer process is responsible for the actual writing of data to Oracle’s physical database files at the operating system level. An important part of this responsibility is the management of the database buffer cache (described under Section 10.3.2.1).

When an application makes a change to data contained in an Oracle database, that change, including inserts and deletes, is first made to a memory buffer. When data is written to a memory buffer, it is marked as “dirty,” as opposed to “clean” or “free.” The DBWR process (and DBWR I/O slaves in Oracle8) is responsible for writing the contents of dirty buffers to the physical disk files, thereby keeping the buffer cache clean. This action has the effect of maintaining an adequate supply of free buffers for use when a user process needs to read data from disk. To accomplish this, the DBWR process utilizes a LRU (least recently used) algorithm to keep the most recently accessed buffers in memory, thereby minimizing I/O, while writing buffers that will not be needed again to disk.

Buffers are written to disk when:

  • A checkpoint is signaled.

  • The dirty list reaches a threshold length, controlled by the INIT.ORA parameter DB_BLOCK_MAX_DIRTY_TARGET.

  • No free or reusable buffers are available.

At least one DBWR process (DBWR in Oracle7, DBW0 in Oracle8) is required, and on many platforms additional DBWR processes can be created. In Oracle7, these additional processes are named DBW1 through DBW9, and the number ...

Get Oracle Database Administration: The Essential Refe now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.