网管联盟 | 网管论坛 | 网管u家 | 网管博客 | 网管软件 | 网管求职 | 小游戏 | 网管搜索 | 网管原创 | 网管聚合 | 网管读摘 | 网管焦点 | 世界素材 | 会员投稿 | 会员中心 
中国网管联盟
Windows Linux Cisco 网络技术 数据库 黑客攻防 DotNet Java PHP 认证 新闻资讯 服务器 存储资讯 网络设备 网管学堂 技术专题 焦点 网吧频道
 当前位置: > bitsCN.com > 数据库技术 > Oracle > 性能调优 > Kill Session[Metalink]  

Kill Session[Metalink]

2004-10-20  作者:BitsCN整理  来源:中国网管联盟  点评 投稿 收藏


  Killing the session will not clear the locks. The session on the remote database will remain idle waiting for input until the network read times out. Only then the kill session is processed, and locks are released.
  Solution Description
  --------------------
  Options:
  ========
  You can shutdown and restart the database or use the ORAKILL utility to kill threads.
  Oracle has provided an ORAKILL utility that will kill shadow threads. Each user's connection is represented by a thread in the Oracle process. If a user's session is killed, then their Oracle session is killed - not the thread.
  Oracle has provided an ORAKILL utility which can be passed a thread ID and will kill the specified thread.
  
  To make sure you do not kill a background process (which would crash your database), you must perform a select to ensure you get the correct thread.
  ---
  select p.spid "OS Thread", b.name "Name-User", s.osuser, s.program
  from v$process p, v$session s, v$bgprocess b

网管u家u.bitscn@com


  where p.addr = s.paddr
  and p.addr = b.paddr UNION ALL
  select p.spid "OS Thread", s.username "Name-User", s.osuser, s.program
  from v$process p, v$session s
  where p.addr = s.paddr
  and s.username is not null;
  ---
  This will list all Shadow processes and backgound processes.
  Each shadow process will show the thread ID - this is what must be killed via the ORAKILL utility.
  
  The kill session behavior is mentioned in the ORACLE7 Server Administrator's Guide (pg 4-13). It does not explicitly indicate what happens to the session while it is in the KILLED PSEUDO state. What's happening is that PMON periodically checks to see if any sessions have been killed.
  If it finds one, it attempts to rollback the transaction for that session(that was in progress when it was killed). The reason this can take a long time is because PMON may have more than one transaction to rollback at a time(if other sessions have been killed, or if processes have died etc). 网管联盟bitsCN@com
  Thus, it may take a while to finally cleanup the killed session and have it disappear from the session monitor. The system i/o monitor correctly shows the reads and writes being performed by PMON in order to rollback the session's transaction.
  
  PMON will not delete the session object itself until the client connected to that session notices that it has been killed. Therefore, the sequence of events is:
  
  1) alter system kill session is issued - the STATUS of the session object in V$SESSION becomes KILLED, its server becomes PSEUDO.
  
  2) PMON cleans up the *resources* allocated to the session(i.e., rolls back its transaction, releases its locks, etc).
  
  3) the entry in V$SESSION remains there until the client of that session (the client is the process associated with the OSUSER,MACHINE,PROCESS columns in the V$SESSION view) tries to do another request.
  
  4) the client attempts another SQL statement and gets back ORA-28.
  
  5) PMON can now remove the entry from V$SESSION.

网管联盟bitsCN_com


  This behavior is necessary because the client still has pointers to the session object even though the session has been killed. Therefore, the object cannot be deleted until the client is no longer pointing at it.

TAGs   s.osuser   Name-User   OSThread   s.program   processp   s.paddr    
 上一篇:Oracle JOB 用法小结   下一篇:学习Oracle--Statspack分析
相关文章列表
Kill Session[Metalink] 评论:
loading.. 评论加载中…
评论:请自觉遵守互联网相关政策法规,评论不得超过250字。

验证码: 注册用户
本类热门排行:
1.Oracle JOB 用法小结
2.如何在oracle中用SQL创建临时表?
3.案例学习Oracle错误:ORA-00604
4.优化Oracle库表设计的若干方法(组图)
5.Oracle中优化SQL的原则
6.案例学习Oracle错误:ORA-12516
7.oracle升级后exp出现oracle 942错误
8.Shared pool深入分析及性能调整
9.Oracle Freelist和HWM原理及性能优
10.通过分析SQL语句的执行计划优化SQL 
最新推荐文章:
1.Oracle数据库9i在AIX环境下的性能调整-性
2.关于优化SQL的另类思考-性能调优
3.深入学习Oracle分区表及分区索引-性能调
4.数据库内存参数调优技术的总结-性能调优
5.Oracle数据库提供的恢复机制-性能调优
6.Oracle数据库提供的多种安全性措施-性能
7.Oracle中fast刷新会受到哪些限制-性能调
8.Oracle数据库始终保持优良性能-性能调优
9.讲解Oracle在Solaris下的性能与调整-性能
10.Shared pool深入分析及性能调整
网管论坛交流:
·不疯魔不成活
·令你大开眼界的真正标准化机房,已整理重
·为赈灾,女孩舍身拍“裸照”
·Windows Server 2003服务器群集创建和配
·exchange2k3全套官方资料
·双儿一周岁了。。。特殊的礼物来啦。。
·存储备份技术版块守则
·无盘技术交流区守则
·DOS命令基础大全之命令详解<作者吐血
·Windows XP 操作系统默认设置需要注意的