oracle session 的 inactive 状态
来源:互联网 发布:淘宝店铺收藏怎么看 编辑:程序博客网 时间:2024/05/01 17:28
inacive是指这个连接已经与数据连接了,但没有当前没有处于空闲状态(没有执行SQL)
检查session数:
select count(*) from v$session
检查process数:
select count(*) from v$process
一个自动杀 的job
CREATE OR REPLACE PROCEDURE "KILL_SESSION" AS
v_sid number;
v_serial number;
killer varchar2(1000);
CURSOR cursor_session_info is select sid,serial# from v$session where type!='BACKGROUND' and status='INACTIVE' and last_call_et>2700 and username='ICWEB' and machine='orc';
BEGIN
open cursor_session_info;
loop
fetch cursor_session_info into v_sid,v_serial;
exit when cursor_session_info%notfound;
killer:='alter system disconnect session '''||v_sid||','||v_serial||''' post_transaction immediate';
execute immediate killer;
end loop;
dbms_output.PUT_LINE(cursor_session_info%rowcount||' users with idle_time>2700s have been killed!');
close cursor_session_info;
END;
/
v_sid number;
v_serial number;
killer varchar2(1000);
CURSOR cursor_session_info is select sid,serial# from v$session where type!='BACKGROUND' and status='INACTIVE' and last_call_et>2700 and username='ICWEB' and machine='orc';
BEGIN
open cursor_session_info;
loop
fetch cursor_session_info into v_sid,v_serial;
exit when cursor_session_info%notfound;
killer:='alter system disconnect session '''||v_sid||','||v_serial||''' post_transaction immediate';
execute immediate killer;
end loop;
dbms_output.PUT_LINE(cursor_session_info%rowcount||' users with idle_time>2700s have been killed!');
close cursor_session_info;
END;
/
这样做其实还是治标不治本,最好能够解决连接池自动释放idle进程的问题
- oracle session 的 inactive 状态
- oracle session 的 inactive 状态
- Oracle session active 和 inactive 状态 说明
- Oracle session active 和 inactive 状态 说明
- Oracle session active 和 inactive 状态 说明
- Oracle session active 和 inactive 状态 说明
- Oracle session active 和 inactive 状态 说明
- Oracle session active 和 inactive 状态 说明
- Oracle session active 和 inactive 状态 说明
- Oracle session连接数和inactive的问题记录
- Oracle中session连接数和inactive的问题记录
- ORACLE SESSION连接数和inactive的问题记录
- Oracle session连接数和inactive的问题记录
- Oracle session连接数和inactive的问题记录
- Oracle session连接数和inactive的问题记录
- Oracle session连接数和inactive的问题记录
- Oracle session连接数和inactive的问题记录
- Oracle RMAN 使用RMAN恢复INACTIVE状态的日志
- c#多线程编程教学:线程同步
- 编程十大好习惯
- 健康常识1
- 网页设计中有效的配色
- linux IPC
- oracle session 的 inactive 状态
- 代码风格
- 中国高新区协会软件园分会7日在青举行
- (Access Report开发系列二)在报表中添加单独页
- C#中怎么把屏幕坐标转化为客户区坐标
- sql server是先写日志还是数据
- 教你过滤Baidu(百度)和搜狐(sougou)的垃圾推销广告
- 高质量C++/C编程指南 -- 第3章 命名规则
- 必须用到和不必使用ajax的地方