Oracle database uses a set of background processes to perform essential tasks that ensure smooth and efficient database operation. These processes run automatically in the background without direct user interaction and handle activities like writing data to disk, managing memory, maintaining consistency, and recovering from failures. They help in reducing the workload on users and improve overall system performance.
These background processes are an important part of Oracle’s architecture because they ensure that transactions are processed reliably and data remains accurate and secure. By managing tasks such as logging, checkpointing, and recovery, they allow the database to function efficiently even in multi-user and high-load environments.
The various oracle processes are listed and explained below:-
1. Log Writer Background Process (LGWR)
The Log Writer (LGWR) is responsible for writing redo log entries from the redo log buffer in memory to redo log files on disk. These entries record every change made in the database, which is important for recovery. LGWR writes data when a COMMIT statement is issued, when the buffer becomes one-third full, or at regular intervals, ensuring that committed transactions are safely stored.
2. Database Writer Background Process (DBWR)
The Database Writer (DBWR) writes modified or dirty blocks from the database buffer cache to the data files on disk. Instead of writing data immediately after every change, it writes in batches to improve performance. It is triggered during checkpoints, buffer shortages, or when many dirty buffers exist, ensuring data is permanently stored.
3. Checkpoint Background Process (CKPT)
The Checkpoint (CKPT) process signals DBWR to write all dirty blocks to disk and updates control files and data file headers. This helps reduce recovery time by marking a consistent point in the database from where recovery can start if needed.
4. Recovery Background Process (RECO)
The Recovery (RECO) process is used in distributed database systems to handle failed transactions. It automatically resolves incomplete distributed transactions and ensures that they are either fully committed or rolled back, maintaining consistency.
5. Lock Background Process (LCKN)
The Lock (LCKN) process manages locks in situations where multiple instances access the same database. It prevents conflicts and ensures that data is accessed in a controlled and consistent manner.
6. Program Monitor Background Process (PMON)
The Program Monitor (PMON) cleans up system resources when a user session fails or disconnects. It releases locks, frees memory, and rolls back uncommitted transactions, helping maintain system stability.
7. System Monitor Background Process (SMON)
The System Monitor (SMON) performs recovery tasks when the database restarts after a failure. It applies redo logs, rolls back incomplete transactions, and ensures that all database files are synchronized and consistent before users begin operations.
Conclusion
These background processes work together to manage database operations efficiently by handling writing, recovery, locking, and maintenance tasks, ensuring reliability and consistency.