oracle_后台进程background process详解

  

  9240380_201008071838591.gif

dbwr进程:
  负责把sga data buffer中的脏数据写到数据文件中(保为脏数据,sga data buffer中被修改的buffer)
冷buffer是根据lru算法计算出来的buffer(就是近期没有被访问过的buffer),dbwr呢,就是把cold buffer
及脏数据写入到数据文件.

   db_writer_processes确定dbwr进程的个数,最大是20


dbwr何时把脏数据写入到磁盘的数据文件
 服务器进程发现找不到一个clean及重用的buffer(在扫描了某个门限数量的缓冲)后,就通知dbwr进程,以
异步方式把脏数据写入到磁盘上

 dbwr定期写入buffer到磁盘以推进checkpoint,checkpoint就是实际恢复开始应用的日志线程位置.
这个位置呢就是,buffer cache中最老及脏的buffer所处位置.

 

lgwr进程:
   管理日志缓冲(log buffer),把自上次写入到日志缓冲的所有重作条目写入以重作日志文件中

   日志buffer(log buffer)是一种环式缓冲结构.

    lgwr写入的条件:
         当提交一个事务时
          日志缓冲:
              每隔三秒
              到1/3满时
              dbwr进程要写修改过的缓冲到磁盘,如有必要时(注:在dbwr要写入一个修改过的缓冲时,所有与此操作相关的在log buffer重作日志
                                                          必须写入磁盘.如果dbwr发现一些重作条目没有写入重作日志文件中,它会通知
                                                         lgwr把相关的重作条目写入到磁盘;并等待lgwr把所有相关的log buffer中的重作条目
                                                         写入重作日志文件,然后dbwr就可以把data buffer中的相关修改过的buffer写入到数据文件中


       用户commit某个事务时,lgwr会在log buffer写入一条提交记录(条目)并把它马上写入到磁盘(重作日志文件),以及产生多条事务重作条目.
    而对于数据块的变更会延迟写入(是指dbwr工作),直到有足够多的变更数据块要写入.这叫作快速提交fast commit.
 
     一个原子写入操作(就是一个包括事务提交记录的的重作条目)就是确定事务提交的单一事件.这时oracle会返回成功信息给提交事务的应用,虽然此时data buffer并没有写入到磁盘中
      (注:有时为了得到更多的log buffer内存,lgwr会在一个事务提交前把相关重作条目写到磁盘上.

 


    在活动频繁程度相当高的时侯,lgwr写重作日志文件采用group commits组提交方式.比如:一个用户提交一个事务,lgwr必须写一个事务重作条目到磁盘,此时其它用户也提交commit命令.

 

 


ckpt进程
        发生ckpt时,oracle必须更新所有数据文件头,记录检查点的细节.ckpt不负责写数据块到磁盘,是dbwr作这个事

 

smon进程
         俗名说系统监控进程.
   负责恢复工作.在实例启动时,如有必要它负责清除不再使用的临时segment,全并采用字典管理方式
   表空间的连续空闲extents.
 
   实例恢复期间因读文件或离线错误,任何中断的事务被skip,smon会恢复它们(当表空间或文件重新变成online)
 
   smon定期检查它要否要作什么工作,其它进程也会根据需要调用smon


  

pmon进程
         负责恢复失败或出故障的用户进程
         清除buffer cache及释放用户进程使用的资源共享(重置活动事务表状态,release锁,删除活动进程表中对应的进程id)
         定期检查调度器及服务器进程的状态,重启任何停止运行的进程.
         注册实例信息及调度器进程到监听器中

 

 

rec进程
         适用于分布式数据库环境中出现故障的分务式事务.

 


job queue processes
           用于批量处理工作.

 

 


下面就不译了

Job Queue Processes
Job queue processes are used for batch processing. They run user jobs. They can be viewed as a scheduler service that can be used to schedule jobs as PL/SQL statements or procedures on an Oracle instance. Given a start date and an interval, the job queue processes try to run the job at the next occurrence of the interval.

Job queue processes are managed dynamically. This allows job queue clients to use more job queue processes when required. The resources used by the new processes are released when they are idle.

Dynamic job queue processes can run a large number of jobs concurrently at a given interval. The job queue processes run user jobs as they are assigned by the CJQ process. Here's what happens:

The coordinator process, named CJQ0, periodically selects jobs that need to be run from the system JOB$ table. New jobs selected are ordered by time.

The CJQ0 process dynamically spawns job queue slave processes (J000…J999) to run the jobs.

The job queue process runs one of the jobs that was selected by the CJQ process for execution. The processes run one job at a time.

After the process finishes execution of a single job, it polls for more jobs. If no jobs are scheduled for execution, then it enters a sleep state, from which it wakes up at periodic intervals and polls for more jobs. If the process does not find any new jobs, then it aborts after a preset interval.

The initialization parameter JOB_QUEUE_PROCESSES represents the maximum number of job queue processes that can concurrently run on an instance. However, clients should not assume that all job queue processes are available for job execution.

 

 

Archiver Processes (ARCn)
The archiver process (ARCn) copies redo log files to a designated storage device after a log switch has occurred. ARCn processes are present only when the database is in ARCHIVELOG mode, and automatic archiving is enabled.

An Oracle instance can have up to 10 ARCn processes (ARC0 to ARC9). The LGWR process starts a new ARCn process whenever the current number of ARCn processes is insufficient to handle the workload. The alert log keeps a record of when LGWR starts a new ARCn process.

If you anticipate a heavy workload for archiving, such as during bulk loading of data, you can specify multiple archiver processes with the initialization parameter LOG_ARCHIVE_MAX_PROCESSES. The ALTER SYSTEM statement can change the value of this parameter dynamically to increase or decrease the number of ARCn processes. However, you do not need to change this parameter from its default value of 1, because the system determines how many ARCn processes are needed, and LGWR automatically starts up more ARCn processes when the database workload requires more.

 


Queue Monitor Processes (QMNn)
The queue monitor process is an optional background process for Oracle Streams Advanced Queuing, which monitors the message queues. You can configure up to 10 queue monitor processes. These processes, like the job queue processes, are different from other Oracle background processes in that process failure does not cause the instance to fail.

fj.pngcncpt154.gif

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/9240380/viewspace-670494/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/9240380/viewspace-670494/

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值