十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
小编给大家分享一下怎么KILL SESSION时保证不中断正在进行的事务,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
赤城网站建设公司创新互联公司,赤城网站设计制作,有大型网站制作公司丰富经验。已为赤城数千家提供企业网站建设服务。企业网站搭建\成都外贸网站建设公司要多少钱,请找那个售后服务好的赤城做网站的公司定做!
通过在ALTER SYSTEM DISCONNECT SESSION 后增加 POST_TRANSACTION来实现事务提交或回滚后,会话才会被KILL掉。
node2:
SQL> conn sh/sh
Connected.
SQL> select sid ,serial# from v$session where sid=userenv('sid');
SID SERIAL#
---------- ----------
142 63
SQL> insert into test select a.* from all_objects a ,all_objects b;
node1:
SQL> alter system disconnect session '142,63,@2' post_transaction;
System altered.
node2:
SQL> insert into test select a.* from all_objects a ,all_objects b;
^Cinsert into test select a.* from all_objects a ,all_objects b
*
ERROR at line 1:
ORA-01013: user requested cancel of current operation
SQL> rollback;
rollback
*
ERROR at line 1:
ORA-00028: your session has been killed
ORACLE DOC:
The POST_TRANSACTION setting allows ongoing transactions to complete before the session is disconnected. If the session has no ongoing transactions, then this clause has the same effect described for as KILL SESSION.
以上是“怎么KILL SESSION时保证不中断正在进行的事务”这篇文章的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注创新互联行业资讯频道!