译
ON
:在Oracle数据库执行每个成功的INSERT、UPDATE、DELETE或PL/SQL块后,向数据库提交处理的更改。OFF
:禁止自动提交,因此您必须手动提交更改(例如,使用SQL命令commit)。IMM[EDIATE] | n
:在Oracle数据库执行n个成功的SQL INSERT、UPDATE或DELETE命令或PL/SQL块后,IMMEDIATE函数以与ON.n相同的方式向数据库提交挂起的更改。n不能小于零或大于200000000。在成功完成n个INSERT、UPDATE或DELETE命令或PL/SQL块、提交、回滚或SET AUTOCOMMIT命令后,语句计数器重置为零。TWO@phytest1:74> show auto
autocommit OFF
TWO@phytest1:74> select * From t1;
no rows selected
TWO@phytest1:74> insert into t1 values(1,userenv('sid'),'xx');
1 row created.
TWO@phytest1:74> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@db ~]$ sqlplus two/two
SQL*Plus: Release 11.2.0.3.0 Production on Thu Dec 26 17:09:56 2024
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
TWO@phytest1:74> select * from t1;
ID SID NAME
---------- -------------------- --------------------------------------------------
1 74 xx
TWO@phytest1:74> SET AUTOCOMMIT ON
TWO@phytest1:74> select * from t1;
no rows selected
TWO@phytest1:74> insert into t1 values(1,userenv('sid'),'xx');
1 row created.
Commit complete.
TWO@phytest1:74> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@db ~]$ sqlplus two/two
SQL*Plus: Release 11.2.0.3.0 Production on Thu Dec 26 17:11:25 2024
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
TWO@phytest1:74> select * From t1;
ID SID NAME
---------- -------------------- --------------------------------------------------
1 74 xx
TWO@phytest1:74> show auto
autocommit OFF
TWO@phytest1:74> show exitc
exitcommit ON
TWO@phytest1:74> select * from t1;
no rows selected
TWO@phytest1:74> insert into t1 values(1,userenv('sid'),'xx');
1 row created.
TWO@phytest1:74> rollback;
Rollback complete.
TWO@phytest1:74> exit
Disconnected from Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
[oracle@db ~]$ sqlplus two/two
SQL*Plus: Release 11.2.0.3.0 Production on Thu Dec 26 17:50:19 2024
Copyright (c) 1982, 2011, Oracle. All rights reserved.
Connected to:
Oracle Database 11g Enterprise Edition Release 11.2.0.3.0 - 64bit Production
With the Partitioning, OLAP, Data Mining and Real Application Testing options
TWO@phytest1:74> select * from t1;
no rows selected
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。