How Does Oracle maintain consistent read?

Source: Internet
Author: User

The principle of consistent read is that the query record is determined by the time point of the query. Even if the query record changes later, the data at that point should be obtained based on the pre-image record of rollback and persistence. How is ORACLE guaranteed? First, we need to know two situations:

1, SCN: System Change Number. This is an incremental number that will only increase and will not decrease. It is stored in the smallest unit block of ORACLE, but the SCN will increase when a block is changed.

2. the rollback segment record slot of the database. The transaction slot is used to allocate the rollback segment space. If you update a transaction, it is written into the transaction slot. If the transaction is not committed or rolled back, the transaction is active. When the database reads the block, it can identify this situation.

Therefore, when Oracle performs consistent read, it first checks whether the initiated SCN is greater than the SCN of the currently queried block. If it is smaller than, there is no doubt that the pre-image data will be obtained from the rollback segment. If the SCN is indeed greater than the SCN of the currently queried block, make sure that there are no active transactions for the block; otherwise, you still need to go to the previous image to find the block.

Therefore, ORACLE rollback segments can both roll back data and ensure consistent read.

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.