简体   繁体   English

隔离级别“ READ COMMITED”在Oracle DB中如何工作?

[英]How isolation level “READ COMMITED” is working in the Oracle DB?

i am interesting to know know how the isolation level"READ COMMITTED" is provided in Oracle DB implementation. 我很高兴知道如何在Oracle DB实现中提供隔离级别“ READ COMMITTED”。 I already know that DB makes records in REDO log, but for now i think that that REDO log is only used to repeat the transaction in case when some unpredictable crash will happen during the transaction. 我已经知道DB在REDO日志中进行记录,但现在我认为REDO日志仅用于重复事务,以防在事务期间发生某些不可预测的崩溃。 Also i know that DBWR writes the "dirty blocks" every time the REDO log file is filled. 我也知道,每次REDO日志文件被填充时,DBWR都会写入“脏块”。 But my question is: if DBWR writes "dirty"(changed blocks) to the disk, how isolation level"READ COMMITTED" is provided. 但是我的问题是:如果DBWR将“脏”(已更改的块)写入磁盘,那么将如何提供隔离级别“ READ COMMITTED”。 I mean during writing DBWR writes data directly to data files or in some special "place" on disk that is visible from current transaction and invisible from other transaction? 我的意思是在写DBWR期间将数据直接写到数据文件或磁盘上某个特殊的“位置”(从当前事务中可见,而从其他事务中看不见)写入数据? So after the COMMIT this "place" becomes visible and that's all ? 那么在COMMIT之后,这个“地方”就变得可见了,仅此而已? How this works in reality? 在现实中这是如何工作的? Sorry for bad English. 对不起,英语不好。

In addition to the REDO log, you also have the UNDO tablespace. 除了REDO日志外,您还具有UNDO表空间。

When updating data, the old value is stored in the UNDO tablespace. 更新数据时,旧值存储在UNDO表空间中。 When Oracle sees that you would be reading uncommitted data for a record, it reconstructs the old value from there. 当Oracle看到您将要读取记录中未提交的数据时,它将从那里重建旧值。

UNDO is also used during database recovery: In addition to re-applying writes that have been committed but not made it to the database files before the crash, the opposite can also take place: rolling back uncommitted changes to database files that happened before the crash. 在数据库恢复期间还可以使用UNDO:除了将已提交但未在崩溃前进行的写入重新应用于数据库文件之外,还可以进行相反的操作:将未提交的更改回退到崩溃前发生的数据库文件。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM