Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Consistent read and current read of oracle

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Oracle consistent reading and current reading, I believe that many inexperienced people do not know what to do about this, so this article summarizes the causes of the problem and solutions, through this article I hope you can solve this problem.

Consistent read: when you "find" a row to be modified, all you get is a consistent read.

Current read: when you get a block to actually update the row you want to modify, the fetch is the current read.

Dml statements actually contain a where sentence, when doing dml, it will first do consistent reading according to the conditions of the where sentence, that is, to find the row that meets the where condition. During the consistent reading, if you find that the found row is locked, oracle will read the undo segment, and then construct a consistent block corresponding to the beginning of the transaction, and finally get the row to be modified.

Oracle then does the current read, that is, to see if the current value of the row to be modified is equal to the consistent read value, and if not, oracle will restart the update.

When restarting the update, oracle uses select for update to lock the line of records before dml, which prevents it from restarting again.

The key reason why select for update prevents restarts is that select for update only does current reads, not consistent reads. In this way, there is no problem of the difference between the two read values due to the time difference between the current read and the consistent read.

After reading the above, have you mastered the consistent reading and the current reading method of oracle? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report