SET TRANSACTION READ ONLY实际上是实现数据库四大事务(ACID)中隔离性(Isolation)的一种手段,用来将数据的读一致性定在某一时间点,即不管其他事务如何更改数据(不能在当前session中再使用自治事务),在当前事务中进行查询的结果始终不变。由于Oracle的读一致性是通过undo段来实现的,所以如果在此期间DML修改的数据量很大而undo空间设置过小可能会导致ORA-01555(快照过旧)错误。
Test Code:
Step 1, @session 1(SET TRANSACTION READ ONLY):
Step 2, @session 2(DML, insert a new record):
Step 3, @session 1(query the same object and get the same result):
Step 4, @session 1(autonomous transaction is not permitted):
Step 5, @session 1(commit current transaction and we get the change):
分享到:
相关推荐
Topics covered: How to use Oracle PL/SQL in all its manifestations through Oracle9i. Fundamentals of program structure (loops, cases, exceptions, etc.) and execution get attention, as do data types, ...
PL/SQL 基础,一个不错的 PL/SQL 参考手册。内容预览: ---- 第一章 PL/SQL 简介 ---- 1. Oracle应用编辑方法概览 1) Pro*C/C++/... : C语言和数据库打交道的方法,比OCI更常用; 2) ODBC 3) OCI: C语言和...
<br> 前言 第1章 PL/SQL综述 1.1 SQL简介 1.2 PL/SQL简介 1.3 Oracle 10g PL/SQL新特征 第2章 PL/SQL开发工具 2.1 SQL*Plus 2.2 PL/SQL Developer 2.3 Procedure ...
The new PL/SQL Clipboard is a dockable tool that stores the history of all SQL and PL/SQL code you copy to the Windows clipboard, so that you can paste the clipboard item again in the future....
You can now filter files based on the name, size, date, read-only status, and version control status. You can specify the filter in the options dialog You also can enter the filter expression directly...
第一部分、SQL&PL/SQL [Q]怎么样查询特殊字符,如通配符%与_ [A]select * from table where name like 'A\_%' escape(避开) '\' [Q]如何插入单引号到数据库表中 [A]可以用ASCII码处理,其它特殊字符如&也一样,如 ...
要创建一个自治事务,您必须在匿名块的最高层或者存储过程、函数、数据包或触发的定义部分中,使用PL/SQL中的PRAGMA AUTONOMOUS_TRANSACTION语句。在这样的模块或过程中执行的SQL Server语句都是自治的。
隔离性强制对事务进行某种程度的隔离,保证应用程序在事务中看到一致的数据。 MySQL提供了下面4种隔离级:序列化(SERIALIZABLE)、可重复读(REPEATABLE READ)、提交读(READ COMMITTED)、未提交读(READ ...
springboot启动报错:java.lang.NoClassDefFoundError: org/springframework/transaction/ReactiveTransactionManager 不添加org.springframework.boot:spring-boot-starter-data-jpa:2.2.5.RELEASE,只有org....
17.4事务的隔离级别 35 17.5数据库开发的关键挑战 35 17.6锁的概念 36 17.7 Oracle的锁机制 36 17.8事务不提交的后果 36 17.9回滚事务rollback 36 17.10保留点savepoint 36 十八、 数据库对象:视图view 37 18.1带子...
内容概述:SQL Server数据库相关内容,对应张磊著《SQL Server数据库应用技术项目化教程》中166页(3)ROLLBACK TRANSACTION将显式事务或隐式事务回滚到事务的结束所对应的源码。代码经个人运行后无误,如果下载后运行...
主要介绍了SQLServer存储过程中事务的使用方法,简短的代码带大家更好的学习使用SQLServer存储过程中事务,感兴趣的小伙伴们可以参考一下
§2.5.10 TRANSACTION (启动事务) 85 §2.5.11 SHOW ALL(列出所有参数) 85 §2.6 格式化输出 87 §2.6.1 一般数据的格式化输出 87 §2.6.2 日期的格式化输出 88 §2.7 加标题 89 §2.8 建立简单报告 90 §2.9 输入...
在PL/SQL 中的事务控制393 让所有的事在一起工作394 示例表及数据394 一个简单的PL/SQL 语句块395 又一个程序398 存储过程包和触发机制403 总结406 问与答407 校练场407 练习407 第19 天TRANSACT-SQL 简介408 目标...
The new PL/SQL Clipboard is a dockable tool that stores the history of all SQL and PL/SQL code you copy to the Windows clipboard, so that you can paste the clipboard item again in the future....
The new PL/SQL Clipboard is a dockable tool that stores the history of all SQL and PL/SQL code you copy to the Windows clipboard, so that you can paste the clipboard item again in the future....
ORACLE的数据字典是数据库的重要组成部分之一,它随着数据库的产生而产生, 随着数据库的变化而变化, 体现为sys用户下的一些表和视图。数据字典名称是大写的英文字符。 数据字典里存有用户信息、用户的权限信息、...
Oracle SQL*Plus Pocket Reference, 2nd Edition Copyright Oracle SQL*PlusPocket Reference Section 1.1. Introduction Section 1.2. Interacting with SQL*Plus Section 1.3. Selecting Data Section 1.4. ...
第1章 数据库与sql基础 1 1.1 数据库的基本概念 1 1.1.1 数据库的由来 1 1.1.2 数据库系统的概念 3 1.2 数据库系统的结构、组成及工作流程 3 1.2.1 数据库的体系结构 3 1.2.2 数据库系统的组成 4 1.2.3 ...