Saturday, October 27, 2012

Oracle's Background Process

Database Writer(DBWR)
This Process  is responsible for writing the dirty buffers(modified) from database buffer cache to the datafiles residing on the physical disk.
It continuously monitor the database buffer cache for free space and if its getting low,DBWR makes room available by writing those data, who are least recently used(LRU) in buffer cache,to the data files.
Note:Though the dirty buffers get write down in the data files but this changed data blocks will not be in effect until an unless user doesn't fire the commit for that transaction.This changes is just for time being whenever oracle face the data buffer cache free space issue.
The database writer process writes dirty buffers to disk under the following conditions:
1. When the database issues a checkpoint
2. When a server process can’t find a clean reusable buffer after checking a threshold number of buffers
3. Every 3 seconds
We can have a maximum of 20 database writer processes (DBW0 through DBW9, and DBWa through DBWj).

Log Writer(LGWR)
This process is responsible to transfer the contents of the redo log buffer to disk. Whenever any changes made to the database table (whether an insertion, update, or deletion), Oracle writes the committed and uncommitted changes to a redo log buffer. The LGWR process immediately transfers these changes from the redo log buffer to the redo log files on disk whenever a user commits a transaction.After write down those dirty redo buffer to online redo log files, LGWR marks that redo log buffers as REUSE.
When we multiplex the redo log, the log writer will write the contents of the redo log buffer to all members of the redo log group. If one or more members are damaged or by any mean become unavailable, the log writer will just write to the available members of a group. If it can’t write to even one member of a redo log group, the log writer signals an error.
The log writer writes all redo log buffer entries to the redo logs under the following circumstances:
• Every 3 seconds.
• When the redo log buffer is one-third full.
• When the database writer signals that redo records need to be written to disk. 

Process Monitor(PMON)
When user processes fail, the PMON cleans up after them, ensuring that the database frees up the resources that the dead processes were using. For example, when a user process dies while holding certain table locks, the PMON process releases those locks so other users can use the tables without any interference from the dead process.


System Monitor(SMON)
The SMON performs system-monitoring tasks for the Oracle instance, such as these:
• Upon restarting an instance that crashed, SMON determines whether the database is consistent.
• SMON cleans up unnecessary temporary segments.
• SMON coalesces free extents if using locally managed tablespaces, which enables to assign larger contiguous free areas on disk to the database objects.

No comments:

Post a Comment