Let's talk about rba, rba = redo byte address.
When it comes to rba, we need to know a few points in advance, that is, controlfile header, ckpt process, dbwn process, and dirty buffer.
Let's take a look at the composition of RBA:
It consists of three parts,4 byte + 4 byte + 2 byteThey are logfile sequence number, logfile block number, byte offsetinto the block, that is, the redo serial number, redo block number, and offset.
And use hexadecimal notation.
Example: rba = 0x000024. 201711bd. 0010
Seq # = 0x000024 = 36
Blk # = 0x000011bd = 4541
Ofs # = 0x0010 = 16
Next, let's talk about instance recovery.
The Checkpoint position here is actuallyCache low rba, End of redo thread is the lastOn-disk rba.
We all know that the cache low rba, on-disk rba, lowrba, and on-disk must be stored in the control file during instance recovery, on-diskrba can be simply understood as the address of the last log file written by lgwr. So how does cache low rba come from?
Cache low rba is the rba written to controlfileheader every 3 seconds by the ckpt process. Therefore, the following article named cache low rba ckpt rba.
As you know, ckpt is divided into three types: database check points, Tablespace and datafile checkpoints and Incremental checkpoints. This is related to the third checkpoints. The incremental checkpoint is used to prevent a large number of dirty blocks from being written to the disk during log switching. It monitors dbwn block writing every three seconds, and write it into controlfile header (excluding datafile header ).
Note the following points:
1. dbwn writes dirtyblock, which is maintained by a two-way linked list called ckpt queue. The dirty block is written to the disk in the lrba order.
2. Each dirty block has an lrba and a pointer to the ckpt queue.
3. For the dbwn trigger conditions, see concepts.
Okay. Let's talk about this experiment:
1. Fetch several pieces of data first
01:57:02 dex @ FAKE> select * from
01:58:10 2 (
01:58:10 3 selectdbms_rowid.rowid_relative_fno (substr (rowid, 1, 15) | 'aaa') as file #,
01:58:10 4 dbms_rowid.rowid_block_number (substr (rowid, 1, 15) | 'aaa') as blk #,
01:58:10 5 max (t. id), max (t. name)
01:58:10 6 from dex. t
01:58:10 7 group by substr (rowid)
01:58:10)
01:58:10 9 where rownum <4;
FILE # BLK # MAX (T. ID) MAX (T. NAME)
--------------------------------------------------
4 446 37949 name
4 447 38433 name
4 442 39401 name
Let's take a look at x $ bh.
02:02:17 sys @ FAKE> select dbablk, lrba_seq, lrba_bno, flag from x $ bh B where file # = 4 and dbablk in (442,446,447 );
DBABLK LRBA_SEQ LRBA_BNO FLAG
----------------------------------------
442 0 0 524288
447 0 0 524288
446 0 0 524288
Check the current ckpt rba and ondisk rba.
02:02:21 sys @ FAKE> selectcplrba_seq, cplrba_bno, cplrba_bof, cpodr_seq, cpodr_bno, cpodr_bof, cphbt, cpodt fromx $ kcccp where indx = 0;
CPLRBA_SEQ CPLRBA_BNO CPLRBA_BOF CPODR_SEQ CPODR_BNO CPODR_BOF CPHBT CPODT
------------------------------------------------------------------------------------------
37105670 37131570 791349660 08/15/2012 02:02:02
2. Update Data
02:07:16 sys @ FAKE> update dex. t set name = 'aaa' where id = 37949;
1 row updated.
02:10:46 sys @ FAKE> update dex. t set name = 'sss' where id = 38433;
1 row updated.
02:10:46 sys @ FAKE> update dex. t set name = 'ddddd' where id = 39401;
1 row updated.
02:10:48 sys @ FAKE> commit;
Commit complete.
3. Check various statuses.
Dirty data
02:10:51 sys @ FAKE> select dbablk, lrba_seq, lrba_bno, flag from x $ bh B where file # = 4 and dbablk in (442,446,447 );
DBABLK LRBA_SEQ LRBA_BNO FLAG
----------------------------------------
442 371442933554433
447 371442933554433
446 371442933554433
The current ckpt rba is 14104
02:10:56 sys @ FAKE> selectcplrba_seq, cplrba_bno, cplrba_bof, cpodr_seq, cpodr_bno, cpodr_bof, cphbt, cpodt fromx $ kcccp where indx = 0;
CPLRBA_SEQ CPLRBA_BNO CPLRBA_BOF CPODR_SEQ CPODR_BNO CPODR_BOF CPHBT CPODT
------------------------------------------------------------------------------------------
37141040 37144370 791349830 08/15/2012 02:10:51