exitcommit
来源:互联网 发布:天心软件怎么用 编辑:程序博客网 时间:2024/06/03 21:57
SQL> select * from v$version where rownum=1;
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
今天做实验时,用的是sqlplus,插入一条数据后,没有提交误关了sqlplus,重新登录后,发现这条数据已经插入了,下面模拟这个过程:
SQL> create table tt(id number);
表已创建。
SQL> insert into tt values(3);
已创建 1 行。
SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开
[oracle@localhost ~]$ sqlplus hr/hr
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 00:09:23 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from tt;
ID
----------
3
查了一下文档,这是11gR2 sqlplus中新添的内容:http://docs.oracle.com/cd/E11882_01/server.112/e16604/ch_twelve040.htm
AUTOCOMMIT EXITCOMMIT EXIT Exit Behavior
默认是set exitcommit on;
当我改成set exitcommit off:
SQL> select * from tt;
ID
----------
3
SQL> insert into tt values(0);
已创建 1 行。
SQL> EXIT
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from tt;
ID
----------
3
BANNER
--------------------------------------------------------------------------------
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
今天做实验时,用的是sqlplus,插入一条数据后,没有提交误关了sqlplus,重新登录后,发现这条数据已经插入了,下面模拟这个过程:
SQL> create table tt(id number);
表已创建。
SQL> insert into tt values(3);
已创建 1 行。
SQL> exit
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开
[oracle@localhost ~]$ sqlplus hr/hr
SQL*Plus: Release 11.2.0.1.0 Production on 星期日 5月 17 00:09:23 2015
Copyright (c) 1982, 2009, Oracle. All rights reserved.
连接到:
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from tt;
ID
----------
3
SET EXITC[OMMIT] {ON | OFF}
Specifies whether the default EXIT behavior is COMMIT or ROLLBACK.
The default setting is ON, which means that work is committed on exit, whether you expected it to be committed or not. Set EXITCOMMIT OFF to rollback work on exit.
Table 12-5 shows the exit action associated with combinations of SET commands (AUTOCOMMIT & EXITCOMMIT) and the EXIT command.
Table 12-5 Exit Behavior: AUTOCOMMIT, EXITCOMMIT, EXIT
ON
ON
-
COMMIT
ON
OFF
-
COMMIT
OFF
ON
-
COMMIT
OFF
OFF
-
ROLLBACK
ON
ON
COMMIT
COMMIT
ON
ON
ROLLBACK
COMMIT
ON
OFF
COMMIT
COMMIT
ON
OFF
ROLLBACK
COMMIT
OFF
ON
COMMIT
COMMIT
OFF
ON
ROLLBACK
ROLLBACK
OFF
OFF
COMMIT
COMMIT
OFF
OFF
ROLLBACK
ROLLBACK
当我改成set exitcommit off:
SQL> select * from tt;
ID
----------
3
SQL> insert into tt values(0);
已创建 1 行。
SQL> EXIT
从 Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options 断开
Oracle Database 11g Enterprise Edition Release 11.2.0.1.0 - Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
SQL> select * from tt;
ID
----------
3
0 0
- exitcommit
- Oracle 11gR2中SQL*Plus中的新设置exitcommit
- 详解在Hibernate中配置数据库方言的作用和好处以及各种数据库的方言连接
- 黑马程序员_08. Object Exception介绍
- 第三章第43题
- 移动应用或者手机游戏现在服务端的架构一般都是怎么样的
- Java中的访问控制public,private,protected,package
- exitcommit
- Easy do it,轻松互联网开发平台(原WebEasy,简称轻开平台)升级公告补充
- csharp: Oracle Metadata queries
- csharp: Oracle Metadata queries
- 设计模式(23)——Visitor(访问者)
- Leetcode Number of 1 Bits(位运算)
- 【WIN32】CMake的学习总结 4——深入动态库
- Java多线程系列--“JUC集合”01之 框架
- Serializable序列化