Oracle Background Processes
The background processes of the Oracle instance manage memory structures, asynchronously perform I/O to write data to a file on a disk, and perform general maintenance tasks. An Oracle database system consists of an Oracle database and an Oracle instance. The database consists of a set of disk files that store user data and metadata, while the Oracle/database instance contains the set of Oracle Database background processes that operate on the stored data and the shared allocated memory that those processes use to do their work.
Each background process has a separate task but works with the other processes. For example, the LGWR process writes data from the redo log buffer to the online redo log. When a filled log file is ready to be archived, LGWR signals another process to archive the file. Oracle Database creates background processes automatically when a database instance starts. The background processes that are present depend on the features and options that are being used in the database. The startup and shutdown of background processes are normally seen logged in the database alert.log.
The following query can be used to list the background processes running on your database:
SQL> SELECT PNAME FROM V$PROCESS WHERE PNAME IS NOT NULL ORDER BY PNAME;
Following query could be used in 12c as all the shared BG process belongs ti con_id=0
SQL> select PNAME,con_id,spid from V$process where con_id=0;
Type of Oracle Background Processes
The Oracle background processes can be majorly distinguished by 3 categories. These are:
1. Mandatory Background Processes
2. Optional Background Processes
3. Slave Processes
1. Mandatory Background Processes
The mandatory background processes are present in all typical database configurations. These processes run by default in a database instance started with a minimally configured initialization parameter file.
Name | Expanded Name | Description |
---|---|---|
PMON | Process Monitor | Monitors the other background processes and performs process recovery when a server or dispatcher process terminates abnormally |
SMON | System Monitor | Performs critical tasks such as crash recovery when the instance is started following a failure, dead transaction recovery, and maintenance tasks such as temporary space reclamation, data dictionary cleanup, and undo tablespace management |
DBWn | Database Writer | Writes modified blocks from the database buffer cache to the data files |
LGWR | Log Writer | Writes redo entries to the online redo log |
CKPT | Checkpoint | Signals DBWn at checkpoints and updates all the data files and control files of the database to indicate the most recent checkpoint |
MMON | Manageability Monitor | Performs many tasks related to manageability, including taking Automatic Workload Repository snapshots and performing Automatic Database Diagnostic Monitor analysis |
MMNL | Manageability Monitor Lite | Performs tasks relating to manageability, including active session history sampling and metrics computation |
RECO | Recoverer Process | Resolves distributed transactions that are pending because of a network or system failure in a distributed database |
2. Optional Background Processes
An optional background process is any background process not defined as mandatory. This would include background processes that are specific to tasks or features installed in a database. For example, the ARCn process only exists when the database is in ARCHIVELOG mode and automatic archiving is enabled. Also, there are many background processes only needed to support Oracle Automatic Storage Management (ASM).
Name | Expanded Name | Description |
---|---|---|
ARCn | Archiver | Copies the redo log files to archival storage when they are full or an online redo log switch occurs |
CJQ0 | Job Queue Coordinator | Selects jobs that need to be run from the data dictionary and spawns job queue slave processes (Jnnn) to run the jobs |
SMCO | Space Management Coordinator | Coordinates the execution of various space management tasks |
3. Slave Processes
Slave processes are background processes that perform work on behalf of other processes. This section describes some slave processes used by Oracle Database.
Name | Expanded Name | Description |
---|---|---|
Innn | Disk and Tape I/O Slave Process | Serves as an I/O slave process spawned on behalf of DBWR, LGWR, or an RMAN backup session |
Pnnn | Parallel Query Slave Process | Perform parallel execution of a SQL statement (query, DML, or DDL) |
Jnnn | Job Queue Slave Process | Executes jobs assigned by the job coordinator |
V$BGPROCESS view
V$BGPROCESS displays information about the background processes.
Column | Datatype | Description |
---|---|---|
PADDR | RAW(4 | 8) | Address of the process state object |
PSERIAL# | NUMBER | Process state object serial number |
NAME | VARCHAR2(5) | Name of this background process |
DESCRIPTION | VARCHAR2(64) | Description of the background process |
ERROR | NUMBER | Error encountered |
New Background Processes In Oracle Database 10g
New Background Processes In Oracle Database 12c