Understanding Redo (5) Deep Learning RBA

Source: Internet
Author: User

1 Definition

RBA is the address corresponding to redo entries in the redo log file.

 

2
Composition

RBA consists of three parts:
Serial number (4 bytes)
Block number (4 bytes)
Start byte (2 bytes)
All of the above are in hexadecimal storage.

 

3 type

3.1 lrba

Definition: Position of the redo entries corresponding to the first dirty block in the redo log file

Note: The CKPT-Q maintains dirty blocks in the order of lrba, and dbwn writes from the CKPT-Q in the order of lrba when a checkpoint event is executed. Lrba is the checkpoint position. From the checkpoint location (lrba), the redo record is applied to the on disk RBA. This process is rollback.

 

3.2 HRBA

Definition: Location of the redo entries generated when a dirty block is last updated in the buffer cache in the redo log file

NOTE: If HRBA> on-disk Raba, the related redo entries of HRBA are still in redo log buffer. If the instance is crash, HRBA cannot be recovered.

 

3.3 checkpoint RBA

Definition: lrba, the first dirty data block in the CKPT-Q, the dirty data before this RBA has been fully written to the disk.

Note: When a checkpoint event occurs, the ckpt process records the address (RBA) of the redo log records written at that time. The recorded RBA is called checkpoint RBA, the dirty blocks in the buffer cache protected by logs from the last checkpoint RBA to the current checkpoint RBA will be written into the data file.

 

3.4 On-disk RBA

Definition: the address at the last position of the log file written by lgwr. Redo the last redo record of the log file in the disk.

Note: On disk RBA is the end point of the Oracle rollback operation. As the name suggests, on disk means 'on disk. RBA, which is higher than this one, is in the log buffer and has not been written into the log files on the disk. therefore, it cannot be used for restoration.

 

3.5 target RBA

Definition: Checkpoint RBA at the end of a checkpoint event

Note: To shorten the instance recovery time, dbwn tries its best to set the checkpoint RBA target value to a long-term point.

 

4 related views

4.1 view the incremental checkpoint RBA and the on-disk RBA -- x $ kcccp

SQL> select CPDRT,CPLRBA_SEQ||'.'||CPLRBA_BNO||'.'||CPLRBA_BOF "Low  RBA",CPODR_SEQ||'.'||CPODR_BNO||'.'||CPODR_BOF "On disk RBA",CPODS,CPODT,CPHBT from x$kcccp;      CPDRT Low RBA         On disk RBA     CPODS            CPODT                     CPHBT ---------- --------------- --------------- ---------------- -------------------- ----------         35 686.124.0       686.220.0       2325376          03/02/2008 15:18:54   648319278 

Note:

The cpdrt column is the number of dirty blocks in the checkpoint queue.
The cpods column is the SCN of on disk RBA.
The cpodt column is the timestamp of on disk RBA.
The cphbt column is the heartbeat

 

4.2 view the lrba and HRBA--X of dirty blocks $ BH, x $ kcvfh (10 Gb later in x $ BH can only view lrba)

-- Lrba

 

SQL> select lrba_seq,lrba_bno from x$bh  where lrba_seq!=0;  LRBA_SEQ   LRBA_BNO---------- ----------       107      42042       107      42260       107      42120

-- HRBA

SQL> select hxfil,fhrba_seq,fhrba_bno,fhrba_bof from  x$kcvfh;     HXFIL  FHRBA_SEQ  FHRBA_BNO  FHRBA_BOF---------- ---------- ---------- ----------         1         76       6618         16         2         76       6618         16         3         76       6618         16         4         76       6618         16

Why query x $ kcvfh is because x $ kcvfh is the source of V $ datafile_header?

 

4.3 view target RBA
-- X $ targetrba

SQL> select target_rba_seq,target_rba_bno,target_rba_bof from x$targetrba;TARGET_RBA_SEQ TARGET_RBA_BNO TARGET_RBA_BOF-------------- -------------- --------------             0              0              0

4.4
Checkpoint RBA -- x $ kccrt for full checkpoint (kernel Cache Control File redo thread)

SQL> select rtckp_rba_seq,rtckp_rba_bno,rtckp_rba_bof from x$kccrt;RTCKP_RBA_SEQ RTCKP_RBA_BNO RTCKP_RBA_BOF------------- ------------- -------------          112             7            16

 

5 Summary

RBA information is not required, because if you open the database in resetlogs mode, all serial numbers will be reset to 1. Redo has a great relationship with checkpoint. When the log_checkpoints_to_alert parameter is set to true, the checkpoint will be written into the Alert Log. In terms of the principle of backup and recovery, Xie Lao's famous saying is quoted here: "That is, the data file header not only contains checkpoint_change #, more importantly, it contains the sequence # Of the logfile where the checkpoint_change # is located, which is exactly RBA. With RBA, you can know exactly which logfile (archivelog
Or redo )"

Through the above explanation, we all know where RBA is in the old saying "thank you.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.