All technological notes.
Background processes
Each background process has a separate task, but works with the other processes. 任务独立, 但相互配合.
LGWR process writes data from the redo log buffer to the online redo log. When a filled redo log file is ready to be archived, LGWR signals another process to archive the redo log file.An instance can have many background processes, not all of which always exist in every database configuration.
SELECT PNAME
FROM V$PROCESS
WHERE PNAME IS NOT NULL
ORDER BY PNAME;

Mandatory background processes
minimally configured initialization parameter file.mandatory background processes:
The PMON group includes PMON, Cleanup Main Process (CLMN), and Cleanup Helper Processes (CLnn).
The PMON group oversees cleanup of the buffer cache and the release of resources used by a client process.
Process Monitor Process (PMON) 监控
Cleanup Main Process (CLMN)清理
PMON delegates cleanup work to the cleanup main process (CLMN).Cleanup Helper Processes (CLnn) 帮助清理
CLMN delegates cleanup work to the CLnn helper processes.V$CLEANUP_PROCESS:
V$DEAD_CLEANUP:
If a process or session terminates, then the PMON group releases the held resources to the database.
V$QUARANTINE: provides information about quarantined objects.
Process Manager (PMAN)
PMAN monitors, spawns, and stops the following types of processes:
Dispatcher and shared server processesConnection broker and pooled server processes for database resident connection poolsJob queue processesRestartable background processeslistener registration process (LREG)
database instance and dispatcher processes with the Oracle Net Listener.When an instance starts, LREG polls the listener to determine whether it is running.
LREG passes it relevant parameters.LREG periodically attempts to contact it.system monitor process (SMON)
Duties:
Performing instance recovery, if necessary, at instance startup.
RAC database, the SMON process of one database instance can perform instance recovery for a failed instance.Recovering terminated transactions that were skipped during instance recovery because of file-read or tablespace offline errors.
Cleaning up unused temporary segments.
Coalescing contiguous free extents within dictionary-managed tablespaces.
SMON checks regularly to see whether it is needed. 定期检查SMON if they detect a need for it. 可以被调用database writer process (DBW)
buffers to data files.buffer cache to disk.one database writer process (DBW0) is adequate for most systems. 一个够用
uniprocessor systems.单进程系统无用Conditions to write dirty buffers to disk:
server process cannot find a clean reusable buffer after scanning a threshold number of buffers, it signals DBW to write. DBW writes dirty buffers to disk asynchronously if possible while performing other processing.dirty buffer in the buffer cache.LGWR. LGWR 是顺序写入, 快; DBW 是离散写入 block, 慢;
DBW writes are scattered throughout the disk.DBW performs multiblock writes when possible to improve efficiency. 多从写入
log writer process (LGWR)
online redo log buffer.buffer to the online redo log.Circumstances to write all redo entries
redo log buffer is one-third full or contains 1 MB of buffered data.DBW must write modified buffers to disk.Before DBW can write a dirty buffer, the database must write to disk the redo records associated with changes to the buffer (the write-ahead protocol). Redo 先于 buffer
DBW discovers that some redo records have not been written, it signals LGWR to write the records to disk, and waits for LGWR to complete before writing the data buffers to disk.如果 redo 未写入, 则等待.fast commit mechanism
COMMIT statement, the transaction is assigned a system change number (SCN).LGWR puts a commit record in the redo log buffer and writes it to disk immediately, along with the commit SCN and transaction’s redo entries.LGWR writes synchronously to the active mirrored group of online redo log files. 同时写多个
LGWR continues writing to other files in the group and writes an error to the LGWR trace file and the alert log.单个失败将继续, 会有警告checkpoint process (CKPT)
control file and data file headers with checkpoint information. 与 cf 和 df 头部有关Checkpoint information includes
online redo log to begin recovery.当恢复时用于与 redo log 对齐.CKPT does not write data blocks to data files or redo blocks to online redo log files.

manageability monitor process (MMON)
Automatic Workload Repository (AWR).MMON writes when a metric violates its threshold value, taking snapshots, and capturing statistics value for recently modified SQL objects.manageability monitor lite process (MMNL)
Active Session History (ASH) buffer in the SGA to disk.In a distributed database, the recoverer process (RECO) automatically resolves failures in distributed transactions.
The RECO process of a node automatically connects to other databases involved in an in-doubt distributed transaction.
optional background process
optional background processes are specific to tasks or features.
some common optional processes:
archiver process (ARCn)
online redo log files to offline storage after a redo log switch occurs.redo data and transmit it to standby database destinations.ARCn processes exist only when the database is in ARCHIVELOG mode and automatic archiving is enabled.
ARCHIVE LOG LIST # check the current mode
SHUTDOWN IMMEDIATE
STARTUP MOUNT # startup and mount the database
ALTER DATABASE ARCHIVELOG; # alter db
ALTER DATABASE OPEN; # Open the database
ARCHIVE LOG LIST # check the current mode


job
queue process
flashback data archive process (FBDA)
Flashback Data Archives.When a transaction containing DML on a tracked table commits, this process stores the pre-image of the changed rows into the Flashback Data Archive. It also keeps metadata on the current rows.
FBDA automatically manages the Flashback Data Archive for space, organization, and retention.SMCO process
slave processes (Wnnn) to implement the task.