Steps for consistent read

Source: Internet
Author: User

The header of each data block contains the ITL information (Interested Transaction list). Each item affects the transaction information of this data block. There is a lock byte in each row, which stores the information of the ITL slot. Therefore, to query the transaction information of a row, you can use byte lock to find the transaction ID in the ITL slot and then query the transaction information from the transaction table in the rollback segment based on the transaction ID.

1. Read the data block.

2. Read the row header.

3. Check the lock byte to determine whether there's an ITL entry.

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

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.

6. Read the last undo block (UBA ).

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.

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.

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.

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

11. If the Undo entry contains:

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.

B. An ITL record, restore the ITL record to the data block. Return to step 4.

Refer:

Http://www.jlcomp.demon.co.uk/cleanout.html
Http://www.ixora.com.au/tips/admin/ora-1555.htm

To refine the steps for consistent reading, please correct:

Start from Step 1:
If you find transaction in transaction table based on transaction ID
If transaction has been commit
If query SCN> commit SCN
Accept the block and clean out. 1 is returned.
Elseif query SCN performs consistent read, from step 1 back
Elseif transaction does not have commit
Also perform consistent read, from step 1 back execution

Elseif does not find transaction in the transaction table (the rollback information is overwritten, indicating that the transaction has been committed, because only the Undo extent in which the transaction is committed can be overwritten. In this way, query SCN compares control SCN. Control SCN refers to the commit SCN of the previous transaction in the last reused transaction slot in the transaction table, that is, the smallest commit SCN that can be found in the transaction table)
If query SCN, the relationship between Query SCN and commit SCN is unknown, and a ORA-01555 error occurs.
If query SCN> Control SCN
Then query SCN must> commit SCN
Accept the block, clean out, and mark the ITL in the block as "u", indicating "Upper Bound commit", and return 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.