Explain how background processes run asynchronously.
Asynchronous Coordination of Oracle Background Processes
Figure 4-4: Oracle background processes run in parallel with user operations, ensuring non-blocking I/O and high concurrency.
In a multiple-process Oracle instance, background processes operate asynchronously to maximize throughput and minimize user wait times. Instead of forcing user transactions to wait for disk I/O or cleanup tasks, Oracle offloads these responsibilities to specialized processes that coordinate through the System Global Area (SGA) and lightweight signals. This design enables non-blocking I/O and high concurrency across the system.
Key Background Processes
PMON (Process Monitor): Cleans up resources after failed sessions, releasing locks and memory asynchronously so other users are not blocked.
SMON (System Monitor): Performs crash recovery, rolls forward redo, rolls back uncommitted transactions, and cleans up temporary space. Runs periodically without interrupting active transactions.
CKPT (Checkpoint): Triggers database writer activity and updates control file and datafile headers with the latest checkpoint information, allowing recovery to skip already-written changes.
DBW0 (Database Writer): Writes dirty buffers from the SGA to datafiles in the background, batching writes to reduce I/O overhead. Coordinates with LGWR to ensure redo is written first.
LGWR (Log Writer): Flushes redo log buffer entries to redo log files at commit time and every few seconds. Enables “fast commits” where user sessions wait only for redo, not datafile writes.
ARC0 (Archiver): Copies full redo log files to offline storage asynchronously after log switches, ensuring recovery capability without pausing transaction flow.
RECO (Recoverer): Resolves in-doubt distributed transactions by contacting remote nodes and completing commits or rollbacks independently.
D000 (Dispatcher): Handles client requests in shared server mode by placing them into SGA queues, allowing shared server processes to pick them up asynchronously.
The processes interact via shared memory buffers and signals:
User processes write changes to the buffer cache and redo buffer without waiting for disk writes.
DBW0 writes dirty blocks asynchronously, after LGWR confirms redo persistence.
LGWR flushes redo quickly at commits and groups multiple commits to minimize I/O.
ARC0 archives logs in the background while new logs are in use.
PMON and SMON continuously clean up and recover resources without interrupting transactions.
By decoupling expensive operations through buffering and asynchronous workers, Oracle ensures that user sessions remain responsive and throughput scales with workload. This architecture is a model for designing high-concurrency systems in other domains.