问题描述
您好,我正在阅读 <<数据库概念>>,
我无法清楚地理解 “交易集一致性”,您能向我解释一下吗?你能告诉我一些简单的例子来展示什么是 “事务集一致性” 吗?
谢谢。
链接是https://docs.oracle.com/cd/B28359_01/server.111/b28318/consist.htm#CIHHDFDH;
A useful way to view the read committed and serializable isolation levels in Oracle Database is to consider the following scenario: Assume you have a collection of database tables (or any set of data), a particular sequence of reads of rows in those tables, and the set of transactions committed at any particular time. An operation (a query or a transaction) is transaction set consistent if all its reads return data written by the same set of committed transactions. An operation is not transaction set consistent if some reads reflect the changes of one set of transactions and other reads reflect changes made by other transactions. An operation that is not transaction set consistent in effect sees the database in a state that reflects no single set of committed transactions.
谢谢你
我无法清楚地理解 “交易集一致性”,您能向我解释一下吗?你能告诉我一些简单的例子来展示什么是 “事务集一致性” 吗?
谢谢。
链接是https://docs.oracle.com/cd/B28359_01/server.111/b28318/consist.htm#CIHHDFDH;
A useful way to view the read committed and serializable isolation levels in Oracle Database is to consider the following scenario: Assume you have a collection of database tables (or any set of data), a particular sequence of reads of rows in those tables, and the set of transactions committed at any particular time. An operation (a query or a transaction) is transaction set consistent if all its reads return data written by the same set of committed transactions. An operation is not transaction set consistent if some reads reflect the changes of one set of transactions and other reads reflect changes made by other transactions. An operation that is not transaction set consistent in effect sees the database in a state that reflects no single set of committed transactions.
谢谢你
专家解答
它的意思是 “查询结果是否与时间点一致?”
例如,假设您有以下两个事务集:
如果查询或事务在t上的查询返回相同的结果,则该查询或事务是 “设置一致的”,而不管这些事务中的哪一个已经完成。
在Oracle数据库中,所有查询都设置为一致-结果在启动时是固定的。
但是在默认模式下,read committed,事务不是。如果运行事务1 (插入),则在单独的会话中运行:
结果是不同的。因此,每个查询都会看到一组不同的事务的结果。因此,它们不是 “设置一致的”。
但是如果你在可序列化模式下重复测试,它们是:
因此,结果与同一组事务一致; 只是tran 1。
您可以从Tom阅读更多关于一致性和隔离级别的信息:
http://www.oracle.com/technetwork/testcontent/o65asktom-082389.html
例如,假设您有以下两个事务集:
create table t ( x int ); /* Tran 1 */ insert into t values (1); commit; /* Tran 2 */ update t set x = 2; commit;复制
如果查询或事务在t上的查询返回相同的结果,则该查询或事务是 “设置一致的”,而不管这些事务中的哪一个已经完成。
在Oracle数据库中,所有查询都设置为一致-结果在启动时是固定的。
但是在默认模式下,read committed,事务不是。如果运行事务1 (插入),则在单独的会话中运行:
select * from t; X 1 -- run tran 2 in the other session select * from t; X 2复制
结果是不同的。因此,每个查询都会看到一组不同的事务的结果。因此,它们不是 “设置一致的”。
但是如果你在可序列化模式下重复测试,它们是:
alter session set isolation_level = serializable; select * from t; X 1 -- run tran 2 in the other session select * from t; X 1复制
因此,结果与同一组事务一致; 只是tran 1。
您可以从Tom阅读更多关于一致性和隔离级别的信息:
http://www.oracle.com/technetwork/testcontent/o65asktom-082389.html
「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。
评论
相关阅读
Oracle DataGuard高可用性解决方案详解
孙莹
545次阅读
2025-03-26 23:27:33
Oracle RAC 一键安装翻车?手把手教你如何排错!
Lucifer三思而后行
508次阅读
2025-04-15 17:24:06
XTTS跨版本迁移升级方案(11g to 19c RAC for Linux)
zwtian
416次阅读
2025-04-08 09:12:48
墨天轮个人数说知识点合集
JiekeXu
413次阅读
2025-04-01 15:56:03
【纯干货】Oracle 19C RU 19.27 发布,如何快速升级和安装?
Lucifer三思而后行
404次阅读
2025-04-18 14:18:38
Oracle SQL 执行计划分析与优化指南
Digital Observer
402次阅读
2025-04-01 11:08:44
Oracle数据库一键巡检并生成HTML结果,免费脚本速来下载!
陈举超
361次阅读
2025-04-20 10:07:02
Oracle 19c RAC更换IP实战,运维必看!
szrsu
355次阅读
2025-04-08 23:57:08
【活动】分享你的压箱底干货文档,三篇解锁进阶奖励!
墨天轮编辑部
325次阅读
2025-04-17 17:02:24
oracle定时任务常用攻略
virvle
322次阅读
2025-03-25 16:05:19