7.29.2008

Background processes

DBWN:
Writes changed datablocks from the database buffer cache back to the datafiles. Modified blocks not yet written to the datafiles are called dirty datablocks . If multiple database writers are configured (by setting initialization parameters), each process is given the name DBWn , where n is either an integer from 0 to 9 or a letter from a to j. The maximum number of database writers allowed in a single Oracle instance is 20.

The DBWn background process writes to the datafiles whenever one of the following events occurs:
--A user’s Server Process has searched too long for a free buffer when reading a buffer into the Buffer Cache.
--The number of modified and committed, but unwritten, buffers in the Database Buffer Cache is too large.
--At a database Checkpoint event. See Chapters 10 and 11 for information on checkpoints.
--The instance is shut down using any method other than a shutdown abort.
--A tablespace is placed into backup mode.
--A tablespace is taken offline to make it unavailable or changed to READ ONLY.
--A segment is dropped.


Log writer (LGWR):
Log writer Transfers data from the redo log buffer cache to the redo log files. A database has a set number of redo log files, which work cyclically. As one log file becomes full, the LGWR will switch to a new, empty log file. Once the LGWR has filled the last redo log file, it will switch back to the first log file and begin reusing them. The LGWR records redo log files frequently, when the following events occur:

• Every three seconds.
• Every time a user commits a transaction.
• When the redo log buffer becomes one-third full.
• When the redo log buffer reaches 1 MB.

Checkpoint process (CKPT):
Synchronizes all database files. Every change made to the data is given a System Change Number (SCN). CKPT updates the headers of all datafiles, control files, and redo logs with the latest SCN and a date and time stamp. In the case of failure, recovery brings all database files up to date by tracking the SCNs in the file headers.

Process monitor (PMON):
Tracks all the other background processes. If a user process fails, PMON handles the cleanup by deallocating memory back to the SGA.

System monitor (SMON):
Handles instance recovery on instance startup, cleans up temporary segments, and consolidates free space in the datafiles.