Oracle 18C新特性:ALTER SYSTEM CANCEL SQL
介绍
18c官方文档《Database Administrator’s Guide》中有介绍,关于取消会话的sql事务有新增特性,可以使用ALTER SYSTEM CANCEL SQL。。对事务取消,具体使用方法如下:
实践证明
##session 1 SQL> select sid, serial# from v$session where sid = userenv(‘SID‘); SID SERIAL# ---------- ---------- 25 29476 SQL> create table t_source as select * from dba_source where 1=2; Table created. SQL> select count(*) from t_source; COUNT(*) ---------- 0 SQL> insert into t_source select * from dba_source; 292640 rows created. <========================== 备注此时的总记录数 SQL> insert into t_source select * from dba_source;
正在执行第2次insert时,在另外一个session执行取消操作。
##session 2 SQL> alter system cancel sql ‘25,29476‘; System altered.
检查session 1 此时的执行信息。
##session 1 SQL> insert into t_source select * from dba_source; insert into t_source select * from dba_source * ERROR at line 1: ORA-01013: user requested cancel of current operation SQL> select count(*) from t_source; COUNT(*) ---------- 292640 <========================== 记录数和第2次插入之前一样
这里可以看到第2次插入的记录已经回滚。
相关推荐
踩风火轮的乌龟 2020-07-26
Morelia 2020-11-03
love0u 2020-08-16
xiaouncle 2020-07-31
THEEYE 2020-06-25
DAV数据库 2020-06-17
lightlanguage 2020-06-13
kuoying 2020-06-07
地下库 2020-05-29
HappyHeng 2020-05-28
lysanderK 2020-05-26
Caleb0 2020-05-08
boredbird 2020-05-06
<add key="RedisPath" value="127.0.0.1:6379"/> todo:这里配置自己redis的ip地址和端口号。//ReadServerList:可读的Redis链接地
天空一样的蔚蓝 2020-05-05
cyydjt 2020-05-04
TyCoding 2020-05-03