oracle数据库管理-sqlnet message from client INACTIVE session


1 问题现象:V$TRANSACTION为ACTIVE,V$SESSION为INACTIVE
如下查询。
select 'alter system kill session ' || '''' || sid || ',' || serial# || '''' ||
       ' immediate;',
       T1.XIDUSN,
       T1.XIDSLOT,
       T1.XIDSQN,
       t1.status,
       T1.START_DATE,
       T2.LOGON_TIME,
       T2.CLIENT_INFO,
       T2.MACHINE,
       t2.status,t2.event
  From v$transaction t1, v$session t2
 where t1.addr = t2.taddr
   and t2.status = 'INACTIVE'
   --and start_date < trunc(sysdate, 'dd')
 ORDER BY T1.START_DATE, T2.LOGON_TIME ASC


1 对于v$TRANSACTION 事务为ACTIVE,并且v$SESSION 为 INACTIVE状态测试。

1 简单事务
insert into t1 select * from t1;--不提交,
在另一会话查询v$transaction和v$session,发现transaction为active,session为 INACTIVE;
2 复杂事务
模拟一个处理比较多的事务

[oracle@gzrac01 ~]$ vi in.sql

insert into t1 select * from t1;  --执行完成未提交。
insert into t1 select * from t1; --执行完成未提交。
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;
insert into t1 select * from t1;  --一直在执行,

分析发现,在V$TRANSACTION中存在active并且v$session也为ACTIVE的会话。
然后我将表空间对应的数据文件缩小,等待这个事务报错。
15044608 rows created.

30089216 rows created.

insert into t1 select * from t1
*
ERROR at line 1:
ORA-01653: unable to extend table SYS.T1 by 8192 in tablespace SYSTEM

insert into t1 select * from t1
*
ERROR at line 1:
ORA-01653: unable to extend table SYS.T1 by 8192 in tablespace SYSTEM

insert into t1 select * from t1
*
ERROR at line 1:
ORA-01653: unable to extend table SYS.T1 by 8192 in tablespace SYSTEM

insert into t1 select * from t1
*
ERROR at line 1:
ORA-01653: unable to extend table SYS.T1 by 8192 in tablespace SYSTEM

sql>
sql>
整个事务中途报错退出,session不退出,但是在V$TRANSACTION中存在active并且v$session也为INACTIVE的会话。


总结,

     无论对于简单事务,事务不提交或者回滚,transaction为ACTIVE,session 为 INACTIVE.
      对于多个DML组成的复杂事务,前面的不提交,后面的一直在运行,则transaction为active,session为 active。
      如果运行报错,且未出现显示或隐式的提交或者回滚,且会话不退出,transaction为ACTIVE,session为 INACTIVE,EVENT           为  sql net message from client。
 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值