Sunday 15 October 2017

oracle background process

An Oracle database server consists of an Oracle database and an Oracle instance. An Oracle
instance is made up of memory structures, known as the System Global Area (SGA), and
background processes that handle much of the behind-the-scenes work involved in running an
instance. The most common background processes are the following:

System Monitor (SMON): Performs crash recovery when the instance is started following
a failure

Process Monitor (PMON): Performs process cleanup when a user process fails

Database Writer (DBWn): Writes modified blocks from the database buffer cache to the
data files on the disk

Checkpoint (CKPT): Updates all the data files and control files of the database to indicate
the most recent checkpoint

LogWriter (LGWR): Writes redo log entries to the disk

Archiver (ARCn): Copies redo log files to the archival storage when a log switch occurs

Server Process and Database Buffer Cache

When a query is processed, the Oracle server process looks in the database buffer cache for any
blocks that it needs. If the block is not found in the database buffer cache, the server process
reads the block from the data file and places a copy in the database buffer cache. Because
subsequent requests for the same block may find the block in memory, the requests may not
require physical reads. The Oracle server uses the least recently used algorithm to age out buffers
that have not been accessed recently to make room for new blocks in the database buffer cache.
Buffers in the buffer cache can be in one of the following four states:

Pinned: Multiple sessions are kept from writing to the same block at the same time. Other
sessions wait to access the block.

Clean: The buffer is now unpinned and is a candidate for immediate aging out, if the
current contents (data block) are not referenced again. Either the contents are in sync with
the block contents stored on the disk or the buffer contains a consistent read (CR) snapshot
of a block.

Free or unused: The buffer is empty because the instance has just started. This state is
very similar to the clean state, except that the buffer has not been used.

Dirty: The buffer is no longer pinned but the contents (data block) have changed and must
be flushed to the disk by DBWn before it can be aged out.

No comments:

Post a Comment