您好,登錄后才能下訂單哦!
小編給大家分享一下怎么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時保證不中斷正在進行的事務”這篇文章的所有內容,感謝各位的閱讀!相信大家都有了一定的了解,希望分享的內容對大家有所幫助,如果還想學習更多知識,歡迎關注億速云行業資訊頻道!
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。