ORACLE的主要进程DBWn,LGWR的工作原理

DBWn defers writing to the data files until one of the following events occurs:
1. Incremental or normal checkpoint
2.The number of dirty buffers reaches a threshold value
3. A process scans a specified number of blocks when scanning for free buffers and cannot find any
4. Timeout occurs
5.A ping request in Real Application Clusters (RAC) environment
6.Placing a normal or temporary tablespace offline
7.Placing a tablespace in read-only mode
8.Dropping or truncating a table
9. ALTER TABLESPACE tablespace name BEGIN BACKUP

LGWR performs sequential writes from the Redo Log Buffer to the online redo log file under the following situations:
1. When a transaction commits
2.When the Redo Log Buffer is one-third full
3.When there is more than 1 MB of changes recorded in the Redo Log Buffer
4.Before DBWn writes modified blocks in the Database Buffer Cache to the data files
5. Every three seconds

Redo Byte Address (RBA)

Recent entries in the redo thread of an Oracle instance are addressed using a 3-part redo byte address, or RBA. An RBA is comprised of

  • the log file sequence number (4 bytes)
  • the log file block number (4 bytes)
  • the byte offset into the block at which the redo record starts (2 bytes)

RBAs are not necessarily unique within their thread, because the log file sequence number may be reset to 1 in all threads if a database is opened with the RESETLOGS option.

RBAs are used in the following important ways.

With respect to a dirty block in the buffer cache, the low RBA is the address of the redo for the first change that was applied to the block since it was last clean, and the high RBA is the address of the redo for the most recent change to have been applied to the block.

Dirty buffers are maintained on the buffer cache checkpoint queues in low RBA order. The checkpoint RBA is the point up to which DBWn has written buffers from the checkpoint queues if incremental checkpointing is enabled -- otherwise it is the RBA of last full thread checkpoint. The checkpoint RBA is copied into the checkpoint progress record of the controlfile by the checkpoint heartbeat once every 3 seconds. Instance recovery, when needed, begins from the checkpoint RBA recorded in the controlfile. The target RBA is the point up to which DBWn should seek to advance the checkpoint RBA to satisfy instance recovery objectives.

The on-disk RBA is the point up to which LGWR has flushed the redo thread to the online log files. DBWn may not write a block for which the high RBA is beyond the on-disk RBA. Otherwise transaction recovery (rollback) would not be possible, because the redo needed to undo a change is always in the same redo record as the redo for the change itself.

The term sync RBA is sometimes used to refer to the point up to which LGWR is required to sync the thread. However, this is not a full RBA -- only a redo block number is used at this point.

The low and high RBAs for dirty buffers can be seen in X$BH. (There is also a recovery RBA which is used to record the progress of partial block recovery by PMON.) The incremental checkpoint RBA, the target RBA and the on-disk RBA can all be seen in X$TARGETRBA. The incremental checkpoint RBA and the on-disk RBA can also be seen in X$KCCCP. The full thread checkpoint RBA can be seen in X$KCCRT.

转载于:https://blog.51cto.com/majesty/671136

最新文章

  1. fatal error LNK1181: 无法打开输入文件“libx264.lib”
  2. 产品经理的高阶能力:商业思维基于商业画布的研习方法论
  3. 子系统单点登录配置说明
  4. 我的世界java版导入地图_趣味地图之世界地形图3D精美版
  5. CDA I级学习 - CDA I级考试大纲
  6. 报表生成器FastReport .Net基本信息介绍
  7. java 内存使用过高_Java服务器内存和CPU占用过高的原因
  8. ftp 创建工具下载,三款ftp 创建工具下载-免安装版(亲测)
  9. stbc 多发送天线 matlab,系统天线论文,关于基于STBC的MIMO-OFDM系统误码性能仿真相关参考文献资料-免费论文范文...
  10. 填坑Ⅰ | 简单的数据结构
  11. 看表空间大小,查询表空间名的表空间文件存放位置,矿展表空间,查看表空间名称...
  12. python3绘制皮卡丘
  13. [重要笔记]路由器的包转发操作(全面认识路由器)
  14. 2018 php面试题
  15. 区块链溯源系统开发:为何百度、阿里纷纷押注区块链溯源
  16. custom的短语_custom的用法总结大全
  17. 知乎周源微信_每周源代码36-PDC,BabySmash和Silverlight图表
  18. 如何在云服务器上部署web项目(CVM)
  19. 2017双基计算机考试,2017年大连双基考试试卷答案.doc
  20. 基于ANSYS的无约束梁的模态分析与实验结果比较

热门文章

  1. mysql数据库的使用与理解( 基于ubuntu 14.0.4 LTS 64位)
  2. settings.xml‘ has syntax errors
  3. 241.为运算表达式设计优先级(力扣leetcode) 博主可答疑该问题
  4. php构造函数里抛出异常_构造函数、析构函数抛出异常的问题
  5. Oracle 触发器(一)
  6. 【BZOJ 1082】[SCOI2005]栅栏 二分+dfs
  7. javascript 原型链实现继承简单例子
  8. [禅悟人生]先将小事做好再来修禅心
  9. Android Bitmap保存时背景变为黑色的问题
  10. C#中的==、Equal、ReferenceEqual