一致读步骤

一致读的步骤:

1. Read the Data Block.

  读数据块

2. Read the Row Header.

  读行头

3. Check the Lock Byte to determine whether there's an ITL entry.

  检查lock字节是否有事务槽

4. Read the ITL entry to determine the Transaction ID (Xid).

  读事务槽,检查事务id

5. Read the Transaction Table using the Transaction ID. If the transaction has been committed and has a System Commit Number less than the query's System Change Number, update the status of the block (block cleanout) and start over at step 1.

   用事务id读取事务表,如果事务已经提交,系统提交的NUMBER小于查询的SCN,修改块的状态(块清除),回到步骤1

6. Read the last undo block (Uba).

  读取最后的undo

7. Compare the block transaction ID with the transaction table transaction ID. If the Transaction ID in the undo block doesn't equal the Transaction ID from the Transaction Table, then issue ORA-1555, Snapshot Too Old.

  比较表的事务id和块的事务id,如果在undo块中的事务id不等于事务表中的,然后报ORA-1555快照过久的错误。

8. If the Transaction IDs are identical, make a copy of the data block in memory. Starting with the head undo entry, apply the changes to the copied data block.

  如果事务id一致,拷贝数据导内存中,从undo头的条目开始,将回滚内容运用到数据块中。

9. If the tail undo entry (the actual first undo entry in the chain, or the last in the chain going backwards!) indicates another data block address, read the indicated undo block into memory and repeat steps 7 and 8 until the undo entries don't contain a value for the data block address.

  如果undo条目尾部指示其他数据库的地址,读取指向的undo块到内存,重复步骤78,直到undo条目不包括其他数据块的地址。

10. When there's no "previous data block address," the transaction has been completely undone.

  当没有先前的数据块地址,这个事务已经完成undo.

11. If the undo entry contains: 如果undo条目包括

a. a pointer to a previous transaction undo block address, read the Transaction ID in the previous transaction undo block header and read the appropriate Transaction Table entry. Return to step 5.

指针指向先前事务的undo块地址,在先前事务undo块头部读取事务id,读取合适的事务表条目,回到第5步。

b. an ITL record, restore the ITL record to the data block. Return to step 4. 一个事务槽记录,为数据块恢复事务槽,回到第4步。

http://www.itpub.net/thread-131231-1-1.html

你可能感兴趣的:(数据库,header,table,less,System,query)