This redo is generated a block cleanout is performed. A block cleanout occurs when the information in the transaction header of the block no longer corresponds to the transaction information in the undo header.
For example:
REDO RECORD - Thread:1 RBA: 0x0000ac.00000134.0080 LEN: 0x0048 VLD: 0x01 SCN: 0x0000.003ddf71 SUBSCN: 1 08/27/2015 03:33:09 CHANGE #1 TYP:0 CLS:1 AFN:1 DBA:0x004138ac OBJ:458 SCN:0x0000.003c92b9 SEQ:1 OP:4.1 ENC:0 RBL:0 Block cleanout record, scn: 0x0000.003ddf71 ver: 0x01 opt: 0x02, entries follow... itli: 2 flg: 2 scn: 0x0000.003c92b9
In the above example the redo record is 72 bytes.
The redo record header is 24 bytes.
The change header is 28 bytes.
There is one redo element and the redo vector is therefore 2 bytes (plus 2 bytes alignment)
The first (and only) element is 20 bytes.
The contents of the element in hex is:
00010102 003DDF71 00000000 00000202 003C92B9
This redo is generated a block cleanout is required at commit time.
This operation was observed for updated blocks when the db_lost_write_protect parameter was set to TYPICAL.
For example the following redo was generated for a single row update operation on an unindexed column.
REDO RECORD - Thread:1 RBA: 0x00009b.00000125.0010 LEN: 0x0078 VLD: 0x05 SCN: 0x0000.003b85b3 SUBSCN: 1 08/26/2015 22:43:37 (LWN RBA: 0x00009b.00000125.0010 LEN: 0001 NST: 0001 SCN: 0x0000.003b85b3) CHANGE #1 TYP:0 CLS:1 AFN:1 DBA:0x00415ceb OBJ:75819 SCN:0x0000.003b85b2 SEQ:1 OP:4.6 ENC:0 RBL:0 ktbcc redo - Commit Time Block Cleanout Change xid: 0x0008.01e.00000761 scn: 0x0000.003b85b2 itli: 1
In the above example case the redo record header includes an LWN structure and is therefore 68 bytes.
Consider another example for the same row:
REDO RECORD - Thread:1 RBA: 0x0000a0.00000170.0120 LEN: 0x004c VLD: 0x01 SCN: 0x0000.003c7e61 SUBSCN: 1 08/26/2015 23:01:06 CHANGE #1 TYP:0 CLS:1 AFN:1 DBA:0x00415ceb OBJ:75819 SCN:0x0000.003c7e61 SEQ:1 OP:4.6 ENC:0 RBL:0 ktbcc redo - Commit Time Block Cleanout Change xid: 0x0004.01f.000006b4 scn: 0x0000.003c7e61 itli: 1
In the above example case the redo record header does not include an LWN structure and is therefore 24 bytes.
Consider the second example:
The redo record length is 0x4c (76 bytes). The redo record header is 24 bytes as it does not include an LWN structure.
The change header is 28 bytes
The element vector is 4 bytes (2 bytes for each element, no alignment required)
The first vector is 16 bytes e.g.:
003C7E61 00000000 001F0004 000006B4
The first vector contains the SCN and the tranaction ID (xid)
The second vector is 1 byte rounded up to 4 bytes e.g.:
00000001
The second vector contains the ITL index (itli):
The following table shows the size in bytes for a single change record with and without LWN
Structure | With LWN | Without LWN | |
REDO RECORD | Redo record header | 24 | 24 |
CHANGE #1 | Change header | 28 | 28 |
Element vector | 4 | 4 | |
Element 1 | 16 | 16 | |
Element 2 | 4 | 4 | |
Total | 120 | 76 |
The redo record can contain multiple 4.6 changes. For example:
REDO RECORD - Thread:1 RBA: 0x0000a0.0000001e.0010 LEN: 0x00ac VLD: 0x05 SCN: 0x0000.003c7db3 SUBSCN: 1 08/26/2015 23:00:59 (LWN RBA: 0x0000a0.0000001e.0010 LEN: 0005 NST: 0001 SCN: 0x0000.003c7db3) CHANGE #1 TYP:0 CLS:1 AFN:2 DBA:0x00800fdb OBJ:6176 SCN:0x0000.003c7db0 SEQ:1 OP:4.6 ENC:0 RBL:0 ktbcc redo - Commit Time Block Cleanout Change xid: 0x0008.006.00000765 scn: 0x0000.003c7db2 itli: 2 CHANGE #2 TYP:0 CLS:1 AFN:2 DBA:0x00800fd3 OBJ:6175 SCN:0x0000.003c7db0 SEQ:1 OP:4.6 ENC:0 RBL:0 ktbcc redo - Commit Time Block Cleanout Change xid: 0x0008.006.00000765 scn: 0x0000.003c7db2 itli: 2
In the above example, the redo record header has an LWN structure. There are two changes within the redo record:
The following table shows the size in bytes for a two change record with and without LWN
Structure | With LWN | Without LWN | |
REDO RECORD | Redo record header | 68 | 24 |
CHANGE #1 | Change header | 28 | 28 |
Element vector | 4 | 4 | |
Element 1 | 16 | 16 | |
Element 2 | 4 | 4 | |
CHANGE #2 | Change header | 28 | 28 |
Element vector | 4 | 4 | |
Element 1 | 16 | 16 | |
Element 2 | 4 | 4 | |
Total | 172 | 128 |
The above redo record therefore occupies 172 bytes.