标签:lte 操作 数据 let comm proc RoCE pre ted
针对Oracle数据库来说,存在若干情况,会话断开,本次测试会话断开后,数据保留情况。
--以下考虑都是基于事务修改未commit
【Oracle复合ACID 持久性Durability,解释说明:事务结束,数据永久保留commit or rollback】
情况A,会话exit方式,数据是否保留,是rollback or commit
select count(*) from t1; 40 delete t1 where id>15; 10 rows deleted. exit select count(*) from t1; 30
#SQL*Plus 执行exit 命令,退出会话,执行commit操作
情况二、kill session ‘sid,serial#‘ immediate 方式
HR@env >delete t1 where id>14; 2 rows deleted. >select sid,serial# from v$session where username=‘HR‘; SID SERIAL# ---------- ---------- 780 33 >alter system kill session ‘780,33‘ immediate; >select count(*) from hr.t1; COUNT(*) ---------- 30
Kill session ,退出会话,执行rollback操作
情况三、kill spid 方式
>delete t1 where id>14; 2 rows deleted. >select spid from v$process where addr=(select paddr from v$session where username=‘HR‘); SPID ------------------------ 18695 >! kill -9 18695 SYS@env >select count(*) from hr.t1; COUNT(*) ---------- 30
Kill spid ,退出会话,执行rollback操作
情况四、shutdown immediate 方式
>delete t1 where id>14; >shutdown immediate; >startup select count(*) from hr.t1; 30
shutdown immediate,退出会话,执行rollback操作
情况四、shutdown abort方式
>delete t1 where id>14; >startup force; >select count(*) from hr.t1; COUNT(*) ---------- 30
shutdown abort,退出会话,执行rollback操作
标签:lte 操作 数据 let comm proc RoCE pre ted
原文地址:https://www.cnblogs.com/lvcha001/p/9062680.html