Multiversion Concurrency Control (311)

本文详细介绍了Oracle数据库如何通过回滚段提供不同级别的读一致性,包括语句级和事务级的一致性读取。通过使用系统更改号(SCN),Oracle确保了每个查询看到的数据都是一致的,并且不受其他正在进行的事务的影响。

Oracle automatically provides read consistency to a query so that all the data that the
query sees comes from a single point in time (statement-level read consistency).
Oracle can also provide read consistency to all of the queries in a transaction
(transaction-level read consistency).

Oracle uses the information maintained in its rollback segments to provide these
consistent views. The rollback segments contain the old values of data that have been
changed by uncommitted or recently committed transactions.

As a query enters the execution stage, the current system change number (SCN) is
determined. As data blocks are read on behalf of the query, only blocks written with the
observed SCN are used.Blocks with changed data (more recent SCNs) are reconstructed from
data in the rollback segments, and the reconstructed data is returned for the query.
Therefore,each query returns all committed data with respect to the SCN recorded at the
time that query execution began. Changes of other transactions that occur during a
query’s execution are not observed, guaranteeing that consistent data is returned for
each query.

多版本并发控制
1. Oracle 利用回滚段中的信息生成一个能保证一致性读的数据
2. 当查询进行执行阶段 , SCN是确定的 .
当查询进行扫描时 , 如果某个数据块内的数据被修改过 ,Oracle将使用回滚段中的信息重建此数据块
供查询使用 .
3. 查询的结果集只包含查询开始执行时就已经提交的数据。在查询执行时,其他事务修改的数据
对此查询来说是无效的

[@more@]

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10599713/viewspace-988772/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10599713/viewspace-988772/

评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符  | 博主筛选后可见
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值