Oracle RBA(Redo Byte Address) 说明

2024-04-04 02:38
文章标签 oracle 说明 address byte redo rba

本文主要是介绍Oracle RBA(Redo Byte Address) 说明,希望对大家解决编程问题提供一定的参考价值,需要的开发者们随着小编来一起学习吧!

 

一. RBA 说明

之前整理了一个rdba和dba 的说明文档,参考:

       Oracle rdba和 dba 说明

       http://blog.csdn.net/tianlesoftware/article/details/6529346

 

       在MOS的文档:Question About RBA (Redo Block Address) [ID 759966.1] 有对RBA的说明。

 

       A"Redo Block Address" (RBA) describes a physical location within aredo log file.

 

RBA 由以下三部分组成:

       (1)the log file sequence number (4 bytes)

       (2)the log file block number (4 bytes)

       (3)the byte offset into the block at which the redo record starts (2bytes)

 

如:RBA[0x19.2.10] 代表 Log squence25, Block number 2 with byte offset 16.

注意这里的格式:都是16进行。

 

Redo 与checkpoint 关系很大,当设置log_checkpoints_to_alert 参数为true后,checkpoint 发生时会写入alert log里。

 

如:

SYS@dave2(db2)>alter system set log_checkpoints_to_alert=true scope=both;

System altered.

SYS@dave2(db2)> alter system switchlogfile;

System altered.

 

log里的信息如下:

Thu Aug 18 18:46:18 2011

ALTER SYSTEM SETlog_checkpoints_to_alert=TRUE SCOPE=BOTH;

Thu Aug 18 18:48:07 2011

Beginning log switch checkpoint up to RBA[0xa.2.10], SCN: 2148380730

Thread 1 advanced to log sequence 10

 Current log# 3 seq# 10 mem# 0: /u01/app/oracle/oradata/dave2/redo03.log

Thu Aug 18 18:52:54 2011

Completed checkpoint up to RBA [0xa.2.10],SCN: 2148380730

Thu Aug 18 19:08:59 2011

Incremental checkpoint up to RBA[0xa.736.0], current log tail at RBA [0xa.80a.0]

Thu Aug 18 19:39:01 2011

Incremental checkpoint up to RBA[0xa.c96.0], current log tail at RBA [0xa.d7c.0]

....

Fri Aug 19 07:10:00 2011

Incremental checkpoint up to RBA[0xa.1688a.0], current log tail at RBA [0xb.8328.0]

Fri Aug 19 07:11:04 2011

Completed checkpoint up to RBA [0xb.2.10],SCN: 2148412930

Fri Aug 19 07:40:02 2011

Incremental checkpoint up to RBA[0xb.896c.0], current log tail at RBA [0xb.89c1.0]

  

 

       根据我们前面的说明,RBA 由三部分组成,第一部分是sequence number,即序列号。

 

在我们贴出来的log里有2个日志序列:RBA [0xa.1688a.0] 和 RBA [0xb.896c.0]。

SYS@dave2(db2)> select to_number('a','xx')from dual;

 

TO_NUMBER('A','XX')

-------------------

                 10

 

SYS@dave2(db2)> selectto_number('b','xxx') from dual;

 

TO_NUMBER('B','XXX')

--------------------

                  11

 

a 对应的是日志序列10,b 对应的是日志序列11.

 

SYS@dave2(db2)> select sequence# fromv$archived_log;

 

 SEQUENCE#

----------

        1

        2

        3

        4

        5

        6

        7

        8

        9

       10

 

SYS@dave2(db2)> select sequence#,group#,status from v$log;

 

 SEQUENCE#    GROUP# STATUS

---------- ---------- ----------------

       11          1 CURRENT

        9          2 INACTIVE

       10          3 INACTIVE

 

根据这个查询结果判断10是已经归档的,11是正在使用的current redo log file。

 

第二部分就是我们对应的block:

SYS@dave2(db2)> selectto_number('1688a','xxxxxxxxx') from dual;

 

TO_NUMBER('1688A','XXXXXXXXX')

------------------------------

                         92298

 

在之前的blog:

       Oracle Dump Redo Log File 说明

       http://blog.csdn.net/tianlesoftware/article/details/6670962

 

里提到,可以根据RBA 来dump redo block:

 

格式如下:

ALTER SYSTEM DUMP LOGFILE 'filename' RBAMIN seqno .blockno RBA MAX seqno . blockno;

 

 示例:

SYS@anqing1(rac1)> alter system dumplogfile'+data/anqing/onlinelog/redo02.log'  rbamin 121 10458  rba max125 10472;

System altered.

 

这里的参数:seqno .blockno; 就是我们RBA中的前2部分。

 

二. RBA 使用

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

 

RBAs are used in the following important ways.

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

      

       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 thecheckpoint queues if incremental checkpointing is enabled -- otherwise it isthe 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. In stance recovery, when needed, begins from the checkpoint RBA recorded in thecontrolfile. 

 

       The target RBA is the point up to which DBWnshould 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 ablock for which the high RBA is beyond the on-disk RBA. Otherwise transactionrecovery (rollback) would not be possible, because the redo needed to undo achange is always in the same redo record as the redo for the change itself.

 

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

 

在上面提到的几种RBA 值可以通过X$BH,和 X$KCCRT 视图进行查看:

       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 ofpartial block recovery by PMON.)

       The incremental checkpoint RBA, the target RBA and theon-disk RBA can all be seen in X$TARGETRBA. The incremental checkpointRBA and the on-disk RBA can also be seen in X$KCCCP.

       The full thread checkpoint RBA can be seen in X$KCCRT.

 

 

 

 

 

-------------------------------------------------------------------------------------------------------

QQ:492913789

Email:ahdba@qq.com

Blog:  http://www.cndba.cn/dave

Weibo:   http://weibo.com/tianlesoftware

Twitter:  http://twitter.com/tianlesoftware

Facebook: http://www.facebook.com/tianlesoftware

Linkedin: http://cn.linkedin.com/in/tianlesoftware

DBA1 群:62697716(满);   DBA2 群:62697977(满)  DBA3 群:62697850(满)  

DBA 超级群:63306533(满);  DBA4 群: 83829929(满) DBA5群: 142216823(满) 

DBA6 群:158654907(满)  聊天 群:40132017(满)   聊天2群:69087192(满)

--加群需要在备注说明Oracle表空间和数据文件的关系,否则拒绝申请

这篇关于Oracle RBA(Redo Byte Address) 说明的文章就介绍到这儿,希望我们推荐的文章对编程师们有所帮助!



http://www.chinasem.cn/article/874608

相关文章

java中新生代和老生代的关系说明

《java中新生代和老生代的关系说明》:本文主要介绍java中新生代和老生代的关系说明,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录一、内存区域划分新生代老年代二、对象生命周期与晋升流程三、新生代与老年代的协作机制1. 跨代引用处理2. 动态年龄判定3. 空间分

MySQL之InnoDB存储引擎中的索引用法及说明

《MySQL之InnoDB存储引擎中的索引用法及说明》:本文主要介绍MySQL之InnoDB存储引擎中的索引用法及说明,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐... 目录1、背景2、准备3、正篇【1】存储用户记录的数据页【2】存储目录项记录的数据页【3】聚簇索引【4】二

mysql中的数据目录用法及说明

《mysql中的数据目录用法及说明》:本文主要介绍mysql中的数据目录用法及说明,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录1、背景2、版本3、数据目录4、总结1、背景安装mysql之后,在安装目录下会有一个data目录,我们创建的数据库、创建的表、插入的

Maven中的profiles使用及说明

《Maven中的profiles使用及说明》:本文主要介绍Maven中的profiles使用及说明,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录主要用途定义 Profiles示例:多环境配置激活 Profiles示例:资源过滤示例:依赖管理总结Maven 中的

Oracle 数据库数据操作如何精通 INSERT, UPDATE, DELETE

《Oracle数据库数据操作如何精通INSERT,UPDATE,DELETE》在Oracle数据库中,对表内数据进行增加、修改和删除操作是通过数据操作语言来完成的,下面给大家介绍Oracle数... 目录思维导图一、插入数据 (INSERT)1.1 插入单行数据,指定所有列的值语法:1.2 插入单行数据,指

Before和BeforeClass的区别及说明

《Before和BeforeClass的区别及说明》:本文主要介绍Before和BeforeClass的区别及说明,具有很好的参考价值,希望对大家有所帮助,如有错误或未考虑完全的地方,望不吝赐教... 目录Before和BeforeClass的区别一个简单的例子当运行这个测试类时总结Before和Befor

Python pip下载包及所有依赖到指定文件夹的步骤说明

《Pythonpip下载包及所有依赖到指定文件夹的步骤说明》为了方便开发和部署,我们常常需要将Python项目所依赖的第三方包导出到本地文件夹中,:本文主要介绍Pythonpip下载包及所有依... 目录步骤说明命令格式示例参数说明离线安装方法注意事项总结要使用pip下载包及其所有依赖到指定文件夹,请按照以

Oracle修改端口号之后无法启动的解决方案

《Oracle修改端口号之后无法启动的解决方案》Oracle数据库更改端口后出现监听器无法启动的问题确实较为常见,但并非必然发生,这一问题通常源于​​配置错误或环境冲突​​,而非端口修改本身,以下是系... 目录一、问题根源分析​​​二、保姆级解决方案​​​​步骤1:修正监听器配置文件 (listener.

Spring中管理bean对象的方式(专业级说明)

《Spring中管理bean对象的方式(专业级说明)》在Spring框架中,Bean的管理是核心功能,主要通过IoC(控制反转)容器实现,下面给大家介绍Spring中管理bean对象的方式,感兴趣的朋... 目录1.Bean的声明与注册1.1 基于XML配置1.2 基于注解(主流方式)1.3 基于Java

Oracle 通过 ROWID 批量更新表的方法

《Oracle通过ROWID批量更新表的方法》在Oracle数据库中,使用ROWID进行批量更新是一种高效的更新方法,因为它直接定位到物理行位置,避免了通过索引查找的开销,下面给大家介绍Orac... 目录oracle 通过 ROWID 批量更新表ROWID 基本概念性能优化建议性能UoTrFPH优化建议注