ITPub博客

首页 > Linux操作系统 > Linux操作系统 > RBA(Redo Byte Address), Low RBA(LRBA), High RBA(HRBA)[final]

RBA(Redo Byte Address), Low RBA(LRBA), High RBA(HRBA)[final]

原创 Linux操作系统 作者:tolywang 时间:2011-03-21 23:23:21 0 删除 编辑

 

首先简单认识重做记录(也可称重做条目),比如:

update test set name='cdf' where id=1;   (name旧值是abc)

下面一行表示一个重做记录

行号   事务ID   file#   block#   row   column  value
1       T1       2        19      -      -      abc   (操作undo)
2       T1       4        120     1      2      cdf   (操作数据块)


RBA就是重做日志记录在重做日志文件中所对应的位置,相当于数据文件中的ROWID,通过这个地

址来定位重做日志条目 。RBA由三个部分组成:

日志文件序列号(4字节)
日志文件块编号(4字节)
重做日志记录在日志块中的起始偏移字节数(2字节)


通常使用RBA的形式有:

LRBA
Redo log file中的LRBA (Low Redo Block Address) 表示脏数据块在buffer cache中第
一次被修改时候所对应的重做条目在重做日志文件中的地址 (Low表示第一次修改)

[LRBA0][LRBA1][LRBA2][LRBA3][LRBA4][LRBA5][LRBA6]


HRBA
数据缓存(buffer cache)中一个脏块最近一次被更新的时候产生的重做日志记录在
重做日志文件中所对应的位置就称为HRBA。

checkpoint RBA
当一个checkpoint事件发生的时候,checkpoint进程会记录下当时所写的重做日志
记录的地址即RBA,此时记录的RBA被称为checkpoint RBA。从上一个checkpoint RBA
到当前的checkpoint RBA之间的日志所保护的buffer cache中的脏块接下来将会被写
入到数据文件当中去。

 


---------------------------------------------------------- 
网络资料

http://www.ixora.com.au/notes/rba.htm

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.

 

http://hi.baidu.com/ryokocha/blog/item/75b9bcef4ec938e0ce1b3ea3.html 

 

 


rba是日志文件中的位置。前滚是从checkpoint queue的起点开始的,此rba之前的所有change都已经同步到硬盘上了。在控制文件中有一条low cache rba,就是日志文件中前滚的起点。


在日志文件中,事务的变化以重做信息流的形式存入到联机日志文件中,在日志文件中,重做信息流的重做实体的位置以RBA(redo byte address)RBA 有   日志文件序号,该日志文件序号内的块号,块内的位置偏移量 三部分组成Checkpoint 完成后,把checkpoint RBA 更新到控制文件Checkpoint 进程每三秒记录检查点队列最小low rba 到控制文件中,Ckpt进程也会记录检查点位置到数据文件的头部,但是只是日志切换时 才写,还不是每三秒。  

 

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

请登录后发表评论 登录
全部评论
Oracle , MySQL, SAP IQ, SAP HANA, PostgreSQL, Tableau 技术讨论,希望在这里一起分享知识,讨论技术,畅谈人生 。

注册时间:2007-12-10

  • 博文量
    5595
  • 访问量
    13468097