Oracle kill inactive 线程
2015-04-20 09:46
155 查看
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='STPT' and machine='wonders_svr2'; 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;
begin
-- Call the procedure
kill_session;
end;
使用DBA用户 创建存储过程 并 执行,否则无法在procedure中访问 v$session
select machine,username,count(*) from gv$session group by machine,username
相关文章推荐
- Oracle kill inactive 线程
- oracle inactive死连接
- Oracle日志文件的状态current/active/inactive/unused
- HOW TO Kill The Running Job in Oracle
- Oracle session inactive状态临时表数据未清空问题
- 手动kill掉inactive session的一个存储过程
- 扩大oracle最大session数以及清除inactive会话
- Oracle日志文件的状态current/active/inactive/unused
- ORACLE KILL SESSION (oracle杀死死锁的线程)
- Windows操作系统kill Oracle线程的实施方案
- Oracle登录失败,ORA-01033:ORACLE initialization or shutdown in progress && ORA-00313 无法打开日志组3(用于线程1)的成员……
- DatabaseOperation_DBM - Kill inactive connection
- Windows操作系统kill Oracle线程的实施方案
- oracle session inactive killed 批量清理
- ORACLE定期清理INACTIVE会话
- Windows环境中Kill掉Oracle线程(orakill)
- 如何在Windows 2000环境中Kill掉单个Oracle线程
- ORACLE定期清理INACTIVE会话
- Windows环境中Kill失落Oracle线程
- [nQSError: 76015] The active Oracle BI Scheduler instance in the cluster could not be determined.