码迷,mamicode.com
首页 > 其他好文 > 详细

Data Consistency(数据一致性)

时间:2017-10-31 12:52:35      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:each   ack   ora   ade   enforce   hba   开始   包括   only   

In Oracle Database, each user must see a consistent view of the data, including visible changes made by a user‘s own transactions and committed transactions of other users. For example, the database must not permit a dirty read, which occurs when one transaction sees uncommitted changes made by another concurrent transaction.

Oracle Database always enforces statement-level read consistency, which guarantees that the data returned by a single query is committed and consistent with respect to a single point in time. Depending on the transaction isolation level, this point is the time at which the statement was opened or the time the transaction began. The Flashback Query feature enables you to specify this point in time explicitly.

The database can also provide read consistency to all queries in a transaction, known as transaction-level read consistency. In this case, each statement in a transaction sees data from the same point in time, which is the time at which the transaction began.

上面的意思是说:在Oracle数据库中,用户看到的是数据的一致性视图,包括自己事务修改和其他用户已提交的事务所做的修改。

Oracle数据库总是保证语句级一致性读,意思是:单个查询所返回的数据是关于单一时间点已提交,而且在这个单一时间点一致的。

这个时间点根据事务隔离等级不同,可以是语句打开时,或者事务开始时。

 

注:设置事务隔离等级语句:

set transaction isolation level SERIALIZABLE | read committed;

set transaction read only;

1.SERIALIZABLE:时间点是事务 begin 时,允许修改,注意如果有其他用户也在同时修改相同数据,这个事务进入阻塞状态。

2.read commited:默认事务隔离等级,时间点是语句 open 时。

3.read only:与 SERIALIZABLE类似,时间点是事务 begin 时,但在事务内不允许一般用户执行DML操作。

 

Data Consistency(数据一致性)

标签:each   ack   ora   ade   enforce   hba   开始   包括   only   

原文地址:http://www.cnblogs.com/shulin-peng/p/7760382.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!