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.
最基本的后台进程会存在在所有的数据库配置中,这些进程默认会在实例启动的时候启动.
This section describes the following mandatory background processes:
Process Monitor Process (PMON) 进程监控进程The process monitor (PMON) monitors the other background processes and performs process recovery when a server or dispatcher process terminates abnormally.
PMON is responsible for cleaning up the database buffer cache and freeing resources that the client process was using. For example, PMON resets the status of the active transaction table, releases locks that are no longer required, and removes the process ID from the list of active processes.
进程监控进程, PMON用于监控其他的后台进程,以及执行进程恢复当一个服务器进程或者是分发进程异常中断的时候.PMON负责清理数据库缓存,释放客户端进程使用的资源.例如,PMON会重置当前活动状态的表的状态,释放不再需要的锁,从活动进程列表中移除没有用的进程ID
The listener registration process (LREG) registers information about the database instance and dispatcher processes with the Oracle Net Listener (see "The Oracle Net Listener"). When an instance starts, LREG polls the listener to determine whether it is running. If the listener is running, then LREG passes it relevant parameters. If it is not running, then LREG periodically attempts to contact it.
监听注册进程,用于注册关于数据库实例和分发进程的Oracle 网络监听信息.当一个实例启动以后, LRED周期性的检查监听是否启动,如果启动,LRED提供相关的参数给监听,如果没有启动,LRED周期性的尝试监听的状态
The system monitor process (SMON) is in charge of a variety of system-level cleanup duties. The duties assigned to SMON include:
系统监控进程负责不同系统级别的清除工作,这些内容包括
Performing instance recovery, if necessary, at instance startup. In an Oracle RAC database, the SMON process of one database instance can perform instance recovery for a failed instance.
执行实例级别的恢复,如果有必要,在实例启动的时候.在Oracle RAC环境中,一个数据库实例的SMON能够对一个已经失败的实例进行恢复.
Recovering terminated transactions that were skipped during instance recovery because of file-read or tablespace offline errors. SMON recovers the transactions when the tablespace or file is brought back online.
恢复那些在实例恢复中由于文件只读或者TBS OFFLINE被中断的事物. SMON恢复这些事物当TBS或者文件上线之后.
Cleaning up unused temporary segments. For example, Oracle Database allocates extents when creating an index. If the operation fails, then SMON cleans up the temporary space.
清楚没有用的临时段.例如说,Oracle数据库在创建索引的时候分配区.如果操作失败,SMON负责清楚这些临时表空间
Coalescing contiguous free extents within dictionary-managed tablespaces.
合并连续的空间区在基于字典管理的表空间中
SMON checks regularly to see whether it is needed. Other processes can call SMON if they detect a need for it.
SMON周期性的进行检查其他进程,其他的进程也会调用SMON.
Database Writer Process (DBW)
The database writer process (DBW) writes the contents of database buffers to data files. DBW processes write modified buffers in the database buffer cache to disk.
Although one database writer process (DBW0) is adequate for most systems, you can configure additional processes—DBW1 through DBW9, DBWa through DBWz, and BW36 through BW99—to improve write performance if your system modifies data heavily. These additional DBW processes are not useful on uniprocessor systems.
DBW用于将数据库缓冲区的内容写入文件中.DBW进程将缓存中已经修改的数据写入DISK中.尽管DBW0对于绝大多数系统已经足够了,但是你仍旧可以配置更多地进程. DBW1到DBW9,或者DBWa到DBWz,或者DBW36到DBW99.如果系统本身修改数据的负载比较高的话可以通过这个方法来改善性能.这些额外的DBW进程对于单核处理器系统是没有帮助的
The DBW process writes dirty buffers to disk under the following conditions:
DBW进程将修改过的数据写入到磁盘中.基于以下的条件:
When a 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.
当一个服务器进程找不到可用的缓存的时候在扫描缓存的阈值之后,便出发DBW写进程,DBW写进程将修改的数据以异步的方式写入磁盘中
DBW periodically writes buffers to advance the checkpoint, which is the position in the redo thread from which instance recovery begins. The log position of the checkpoint is determined by the oldest dirty buffer in the buffer cache.
DBW周期性的写入数据到磁盘在检查点进程之前.即redo thread的执行过程中当实例恢复开始的时候.检查点的日志节点由最先被修改的数据决定
In many cases the blocks that DBW writes are scattered throughout the disk. Thus, the writes tend to be slower than the sequential writes performed by LGWR. DBW performs multiblock writes when possible to improve efficiency. The number of blocks written in a multiblock write varies by operating system.
在很多情况中被DBW写入的数据页都是不规则的分布在磁盘中的.因此. 写的过程比LGWR来说是比较慢.DBW一般会采取多个数据块同时写以提高性能.至与能同时写入多少块需要由操作系统决定.
The log writer process (LGWR) manages the online redo log buffer. LGWR writes one portion of the buffer to the online redo log. By separating the tasks of modifying database buffers, performing scattered writes of dirty buffers to disk, and performing fast sequential writes of redo to disk, the database improves performance.
In the following circumstances, LGWR writes all redo entries that have been copied into the buffer since the last time it wrote:
日志写进程管理在线REDO日志缓存.LGWR将一部分缓存的内容写入在线redo日志, 通过独立的修改数据库缓存的作业,以多进程写入的方式将修改过的数据同时写入到磁盘中,并且执行快速的顺序写的磁盘中.在下列环境中,LGWR将所有的已经复制到缓存中的redo信息写入到redo log 中
A user commits a transaction (see "Commits of Transactions").
一个用户提交的事物
An online redo log switch occurs.
在线日志的日志切换
Three seconds have passed since LGWR last wrote.
每三秒
The redo log buffer is one-third full or contains 1 MB of buffered data.
redo log buffer有三分之一被占用或者包含1M的数据
DBW must write modified buffers to disk.
DBW将数据写入磁盘的时候
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). If 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.
在DBW写入修改的数据之前,数据库必须修改过的数据写入redo文件里面.如果DBW检测到一些redo记录没有被记录,则会出发LGWR日志去写入REDO,并且等待LGWR完成之后才会写入数据到磁盘中
Oracle Database uses a fast commit mechanism to improve performance for committed transactions. When a user issues a 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.
数据库使用快速提交机制用于改善性能.当一个是用户发出COMMIT命令,这个事物被分配到一个SCN,LGWR将一个提交的记录以及提交的SCN号还有事物的redo信息立刻写入到磁盘.
The redo log buffer is circular. When LGWR writes redo entries from the redo log buffer to an online redo log file, server processes can copy new entries over the entries in the redo log buffer that have been written to disk. LGWR normally writes fast enough to ensure that space is always available in the buffer for new entries, even when access to the online redo log is heavy.
redo 日志缓存是循环的.当LGWR将redo信息从缓存中写入在线日志的时候,服务器进程能够复制这些从redo缓存里面已经写入到磁盘的信息.LGWR一般会快速写入以保证空间可用,即使是访问online redo很繁忙的时候
The atomic write of the redo entry containing the transaction's commit record is the single event that determines that the transaction has committed. Oracle Database returns a success code to the committing transaction although the data buffers have not yet been written to disk. The corresponding changes to data blocks are deferred until it is efficient for DBW to write them to the data files.
一个redo记录的最小写入单位包含一个事物的提交记录当这个事物被提交的时候.数据库返回一个成功的代码尽管数据库缓存的信息还没有写入到磁盘中.与其相应的数据库写进程会被延迟知道有足够的DBW处理这些数据
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8747612/viewspace-1965973/ ,如需转载,请注明出处,否则将追究法律责任。