For example the instance illustrated in the following figure has 100 log blocks in its log buffer. After a log switch, an SGA variable (b) is set to indicate that the base disk block for the log buffer is block 2. Another SGA variable (i) is used for the index into the log buffer for redo generation. This is shown as pointing to log buffer block 30 shortly after the log switch. A little later, after several log writes have occurred, the base disk block for the log buffer is disk block 82. This maps to log buffer block 81. Redo generation continues and wraps from log buffer block 100 to log buffer block 1. At the moment illustrated the index into the log buffer for redo generation is block 5. This maps to disk block 106. The log buffer is used cyclically in this way until i maps to the last block in the log file.
The variables b and i are both protected by the redo allocation latch. Thus the redo allocation latch is needed not only to allocate space in the log buffer for redo generation, but also to free space in the log buffer after each redo write.
According to bug 182447, the variables shown here as b and i are actually called kcrfsfbb and kcrfsfi internally. They appear to reside in the kcrfsg structure.
© Ixora Pty Ltd. All rights reserved.
28-Mar-2002 |
|