Home » Oracle Basics » 01 - An Introduction to Databases and Oracle
1

Oracle Background Processes

Performing global operations and cleaning up after a system failure

The Oracle System Monitor or SMON process is created when a database instance is started. The SMON process performs global operations like instance recovery and cleans up after shutdown due to system failure. Also, the SMON continuously searches for adjacent free extents and concatenates them to a single extent. User processes that have failed for some reason are processed by PMON or the process monitor. PMON releases any locks on database objects held by such processes, frees up their resources, and clears their data from the cache. The DBWR (Database Writer) background process updates the contents of the data buffer cache and dictionary cache (the places where all database operations are stored in memory) in batch mode. DBWR typically executes when new data needs to be added to the SGA buffers and the buffers are almost full. In such cases, DBWR writes the least recently accessed data to the datafiles and thus frees up SGA buffers. The checkpoint process (CKPT) notifies the DBWR at checkpoints to update all of the datafiles and control files of the database. One SMON and one PMON process runs per database instance while multiple DBWR processes may run at the same time. A parameter named DB_WRITER_PROCESSES in an initialization file may be used to set the number of concurrent DBWR processes.

The Log Writer (LGWR) process controls the process of redo log file updating from redo log buffer contents. The redo logs contains a record of all commands executed by the database and all data inserted and modified. The Archiver process (ARCH) reads the redo log files and writes the data within to specified archive log destination(s). These archive logs are used to restore the database to the current state from a certain point of time in case of system failure. The entries to these logs are updated in batch mode. The LGWR is the only process that directly accesses the redo log buffer during normal database operation. Running a large number of ARCH processes may have an adverse impact on database speed. The recover process automatically cleans up failed or suspended transactions.