Block Repair is the simplest recovery, which is automatically done by the system during normal operation of the database, and is almost impossible for users to feel.
7.1 Block repair initialization and operation
The foreground process calls the Redo program when modifying a buffer to apply a change vector when the foreground process is dead or triggers an error that causes the buffer state to be inconsistent, and block fixes are used to fix the state of the buffer. The repair process includes: (i) reading the block from disk, (ii) Rebuilding the consistent version of the buffer with the redo log of the current thread, and (iii) writing the repaired block back to disk. If the block fix fails for the first time, it tries the second time, then identifies the block as a logical corruption (the number of the block is set to 0), and then triggers a block-corrupted error.
Block repair It is possible to build buffers using the redo log of the current thread because:
Block fixes cannot use the redo logs of other threads or redo logs prior to the last checkpoint of the thread.
The online log is not reused until the current thread checkpoint exceeds the log.
None of the data buffers need to be recovered from the redo log prior to the last thread checkpoint.
7.2 Buffer Header RBA field
The buffer header (a memory data structure) contains the following fields related to the block fix:
Low-rba and High-rba:low-rba are the addresses of the first redo logs that have been applied since the last block cleanup operation of the block, High-rba is the address of the redo log for the most recent change to the data block. The combination of the two describes the redo log scope required to change the data block from the version on disk to the latest version.
Recovery-rba: When the execution block fixes the Pmon process and completes all the block fixes it may take a long time to log the progress with Recover-rba.
7.3 Pmon and foreground process calls
The foreground process performs a block fix if the foreground process complains when the callback redo log program is made, and if the foreground process is not an error, the Pmon process performs a block fix.
Block repair may require a large amount of time and I/O. However, the Pmon process can have plenty of time to do block fixes while ignoring other urgent tasks. There is therefore a limit to the amount of redo logs used for each Pmon execution block repair (a constant that specifies the number of redo log blocks that can be used per Pmon call). The Recovery-rba field of the data buffer is updated to record its progress each time the Pmon execution block repair has finished applying the largest redo log. When the Recovery-rba value reaches the High-rba value, the block repair process for the block ends.
See more highlights of this column: http://www.bianceng.cnhttp://www.bianceng.cn/database/Oracle/