undo機制工作原理描述的:

maojinyu發表於2010-12-24
1. User 1 updates a record in block 777 (user 1 has not committed).
2. User 2 queries the same block and sees that the lock byte is set for a row being queried.
3. User 2 goes to the ITL portion of the block and gets the XID (transaction ID).
4. The XID (transaction ID) maps to the UNDO block, which holds the information before the update was done. If using IMU, then a check is done to see if the undo for this transaction is available in memory before going to the UNDO block.
5. A clone of the block is done (call it block 778).
6. The UNDO information is applied to the block, rolling it forward, but to where it used to be.
7. Block 777 is a CURRENT block.
8. Block 778 is a CONSISTENT READ block before the User 1 update occurred.
9. If another user wants to do a query before the commit, that user can also read the CR version.[@more@]

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/9907339/viewspace-1043591/,如需轉載,請註明出處,否則將追究法律責任。

相關文章