I. RBA description
I have prepared a description document for rdba and DBA. For details, refer:
Oracle rdba and DBA description
Http://blog.csdn.net/tianlesoftware/article/details/6529346
In the mos documentation, question about RBA (redo block address) [ID 759966.1] describes RBA.
A "redo block address" (RBA) describes a physical location within aredo log file.
RBA consists of the following three parts:
(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 (2 bytes)
For example, RBA [0x19. 2.10] indicates log squence25, block number 2 with byte offset 16.
Note that the format is 16.
Redo has a great relationship with checkpoint. When the log_checkpoints_to_alert parameter is set to true, the checkpoint will be written to the Alert Log.
For example:
Sys @ dave2 (DB2)> alter system set log_checkpoints_to_alert = true scope = both;
System altered.
Sys @ dave2 (DB2)> alter system switchlogfile;
System altered.
The information in log is as follows:
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]
According to our previous instructions, RBA consists of three parts: The first part is the sequence number, that is, the serial number.
There are two log sequences: RBA [0xa. 1688a. 0] and 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 corresponds to log sequence 10, B Corresponds to log sequence 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
Based on the query results, 10 is archived, and 11 is the current redo log file in use.
The second part is the corresponding block:
Sys @ dave2 (DB2)> selectto_number ('1688a', 'xxxxxxxxxxx') from dual;
To_number ('1688a', 'xxxxxxxxxxx ')
------------------------------
92298
In the previous blog:
Oracle dump redo log file description
Http://blog.csdn.net/tianlesoftware/article/details/6670962
We can use RBA to dump the redo block:
The format is as follows:
Alter system dump logfile 'filename' rbamin seqno. blockno RBA Max seqno. blockno;
Example:
Sys @ anqing1 (Rac1)> alter system dumplogfile '+ Data/Anqing/onlinelog/redo02.log 'rbamin 121 10458 RBA max125 10472;
System altered.
Here the parameter: seqno. blockno; is the first two parts in our RBA.
Ii. Use 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 dbwnshoshould 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) wocould 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.
The preceding RBA values can be viewed in the x $ BH and x $ kccrt views:
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.
Bytes -------------------------------------------------------------------------------------------------------
Blog: http://blog.csdn.net/tianlesoftware
WEAVER: http://weibo.com/tianlesoftware
Email: dvd.dba@gmail.com
Dba1 group: 62697716 (full); dba2 group: 62697977 (full) dba3 group: 62697850 (full)
Super DBA group: 63306533 (full); dba4 group: 83829929 (full) dba5 group: 142216823 (full)
Dba6 group: 158654907 (full) chat group: 40132017 (full) chat group 2: 69087192 (full)
-- Add the group to describe the relationship between Oracle tablespace and data files in the remarks section. Otherwise, the application is rejected.