Data Consistency(数据一致性)
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了Data Consistency(数据一致性)相关的知识,希望对你有一定的参考价值。
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(数据一致性)的主要内容,如果未能解决你的问题,请参考以下文章
数据一致性(consistency)服务可用性(availability)分区容错性(partition-tolerance)
MySQL MGR数据一致性关键参数group_replication_consistency
MySQL MGR数据一致性关键参数group_replication_consistency
事务四大特性——一致性(Consistency)——MVCC