Overview Background Processes Flashcards
PMON Group (4 Items, plus example)
Group includes:
+ PMON - Process Monitor
+ CLMN - Cleanup Main Process
+ CLnn - Cleanup Helper Proces
+ They are responsible for monitoring and cleaning up other processes.
+ It oversees the cleanup of buffer cache and releases resources used by a client process.
+ Can quarantine corrupted, unrecoverable resources so that the db instance is not immediately terminated.
+ If a server or dispatcher process terminates abnormally, then PMON group is responsible for performing process recovery.
+ i.e resetting status of active translation table, releasing locks, and removing process IDs of terminated processes.
PMON
PMON - Process Monitor Process
+ Detects the termination of other background processes.
CLMN
CLMN - Cleanup Main Process
+ Receives delegation work from PMON for cleanup work.
+ Periodically performs cleanup of the following:
++ Terminated process
++ Terminated sessions
++ Terminated/detached network connections
++ Terminated/detached transactions
++ Idle sessions
CLnn
CLnn - Cleanup Helper Processes
+ Receives delegation from CLMN
+ Assists in the cleanup of terminated processes and sessions
+ The number of helpers is proportional to the amount of cleanup work
+ A cleanup helper can become blocked preventing it from cleaning up other processes.
+ Oracle uses multiple helper processes in parallel for performance
+ V$CLEANUP_PROCESS, V$DEAD_CLEANUP
PMAN
PMAN - Process Manager
Oversees several background processes including shared servers, pooled servers and job queues
+ PMAN monitors and spawns, and stops the following processes:
++ Dispatcher and shared server process
++ Connection broker and pooled server processes for the db resident connection pools
++ Job queue proesses
++ Restartable background processes
LREG
LREG - Listener Registration Process
+ Registers info about db instances and dispatcher process with the oracle net listener
+ When an instance starts, LREG polls the listener to determine whether is it running.
+ If running, the LREG passes it relevant parameters.
+ If not running, the LREG periodically attempts to contact it.
SMON
SMON - System Monitor Process
Duties assigned to SMON below:
+ Perform instance recovery, if needed, at instance startup.
+ In RAC solution - SMON process of one db instance can perform instance recovery of a failed instance
+ Recover terminated transactions that were skipped during instance recovery because of file-related or tablespace offline errors. SMON recovers them when they are back online
+ Cleanup unused temp segments.
+ Unite contiguous free extends within the dictionary-managed tablespaces.
DBW
DBW - Database Writer Process
Writes content of the db buffers to data files (disk).
Multiple DBW are possible:
+ DBW1-DBW9
+DBWa-DBWz
+DB36-DB99
DBW writes dirty buffers to disk under the following conditions:
+ A server process cannot find a clean reusable buffer after scanning a threshold number of buffers, it signals DBW to write.
+ DBW writes to disk async if possible while performing other processes.
+ DBW periodiacally writes to advance the checkpoint.
In many cases DBW writes are scattered throughout the disk. Writes tend to be slower than the sequential writes of LGWR.
+ DBW performs multiblock writes when possible to improve efficiency.
LGWR
LGWR Log Writer Process
+ Manages the online redo log buffer
+ Writes one portion of the buffer to the online redo log.
+ By separating tasks of modifying db buffers, performing scattered writes of dirty buffers to disk and performing fast sequential writes of redo to disk, the db improves performance.
+ LGWR writes all redo entries that have been coppied to buffer since the last time it wrote:
++ User commits a transaction
++ Online redo log switch occurs
++ 3 sec have past since the last LGWR write.
++ Redo log buffer is 1/3 full or contains 1MB of buffered data
++ DBW must write modified buffers to disk
+ Before DBW can write a dirty buffer, the db must write to disk the redo records associated with changes to the buffer. If the DBW discovers that some redo records have not been written to, it signals LGWR to write records to disk and waits for the LGWR to complete before writing the data buffers to disk.
LGWR and Commits
+ Oracle uses a fast commit mechanism to improve performance
+ issuing a COMMIT statement, the transaction is assigned a SCN (System Change Number). LGWR puts a commit record into the redo log buffer and writes to disk immediately, along with the commit SCN and transaction redo entries.
+ Redo buffer is circular
+ When LGWR writes redo log buffer to an online redo log file, the server process can copy new entries over the entries in the redo log buffer that have been written to disk.
+ LGWR usually writes fast enough to ensure space is always available in the buffer for new entries, even with heavy volume.
+ The atomic write of the redo entry containing the transactions commit record is the single event that determines that the transaction has been committed.
+ Returns success code to the committed transaction although the data buffers have not yet been written to disk.
+ When activity is high, LGWR can use group commits from buffer to disk.
LGWR and Inaccessible Files
+ LGWR writes synchronously to the active mirrored group of online redo log files.
+ If a log is inaccessible, then LGWR continuous to write to other files in the group.
+ It writes an error to the LGWR trace file and the alert log.
+ If all files in the group are damaged, or unavailable because it has not been archived, then the LGWR cannot continue to function.
CKPT
CKPT - Checkpoint Process
+ Updates the control file and the data file headers and checkpoint information and signals DBW to write blocks to disk.
+ Checkpoint info includes checkpoint position, SCN, and location in the online redo log to begin recovery.
MMON and MMNL
MMON - Manageability Monitor Process
MMNL - Manageability Monitor Lite
+ MMON performas many tasks related to Automatic Workload Repository (AWR)
+ i.e - Writes when a metric violates its threshold value, taking snapshots, and capturing statistics value for recently modified SQL objects
+ MMNL writes statistics from the Active Session History (ASH) buffer in the SGA to disk.
+ MMNL writes to disk when the ASH buffer is full.
RECO
RECO - Recoverer Process
+ Automatically resolves failures in distributed translations in distributed databases.
+ The RECO process of a node automatically connects to other dbs involved in an in-doubt distributed transaction.
+ When RECO reestablishes connection between the dbs, it automatically resolves all in-doubt transactions, removing from each dbs pending transaction table any rows that correspond to the resolved transactions.
ARCn
ARCn - Archiver Process
+ copies online redo log files to offline storage after a redo log switch occurs.
+ Can also collect transactions redo data and transmit it to standby db destinations.
+ Only exists when the db is in ARCHIVELOG mode and automatic archiving is enabled.