Oracle isolation)

Source: Internet
Author: User

I in database transactions (acid) refers to isolation (isolation): Unfinished (that is, uncommitted) transactions must be invisible. During a transaction, only one session that executes the transaction can see the changes.

Oracle uses restoration segments to implement isolation. Objective of Undo: (1) transaction recovery; (2) Transaction rollback; (3) read consistency

Code

SQL > Select Name, Value From V $ Parameter Where Name Like   ' % Undo % ' ;

NAME value
------------------------------------------------------------
Undo_management auto
Undo_tablespace undo
Undo_retention900

Next we will analyze the isolation implementation through the update process.

 

First, place a lock on all records affected by the DML operation and the associated index key, and then generate a redo. At this time, the server process writes data in the log buffer to be applied to changes in the specified data block. This redo generation operation applies to changes in data blocks and changes in undo blocks. If a column is part of an index, it also writes changes in the index and changes in the Undo block to the log buffer. After the redo is generated, the (1) (2) operation is completed. Then, as shown in the image.

 

PS: At the beginning, I never understood isolation. That is, if there is no commit, only the update session can be executed to see the change. Other sessions can still see the original value. Even more confused, When you execute commit (only triggering lgwr and not triggering dbwr), the data is not actually written to DB files, the updated value can be seen in other sessions. It is not confusing until you know how to use the Undo segment and redirection.

 

Related Article

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.