网络编程 | 站长之家 | 网页制作 | 图形图象 | 操作系统 | 冲浪宝典 | 软件教学 | 网络办公 | 邮件系统 | 网络安全 | 认证考试 | 系统进程
Firefox | IE | Maxthon | 迅雷 | 电驴 | BitComet | FlashGet | QQ | QQ空间 | Vista | 输入法 | Ghost | Word | Excel | wps | Powerpoint
asp | .net | php | jsp | Sql | c# | Ajax | xml | Dreamweaver | FrontPages | Javascript | css | photoshop | fireworks | Flash | Cad | Discuz!
当前位置 > 网站建设学院 > 网络编程 > 数据库 > Oracle教程
Tag:注入,存储过程,分页,安全,优化,xmlhttp,fso,jmail,application,session,防盗链,stream,无组件,组件,md5,乱码,缓存,加密,验证码,算法,cookies,ubb,正则表达式,水印,索引,日志,压缩,base64,url重写,上传,控件,Web.config,JDBC,函数,内存,PDF,迁移,结构,破解,编译,配置,进程,分词,IIS,Apache,Tomcat,phpmyadmin,Gzip,触发器,socket
数据库:数据库教程,数据库技巧,Oracle教程,MySQL教程,Sybase教程,Access教程,DB2教程,数据库安全,数据库文摘
本月文章推荐
.ORACLE问题,每天10问(七).
.静态 SQL语句中的“动态”功能.
.oracle数据库如何增加表空间大小.
.判断Oracle的两个Undo日志之间的.
.Oracle压力测试之orabm.
.postfix时常提示出现关于set-uid.
.Oracle不同数据库间的对比分析脚.
.PL/SQL基础:阶层查询.
.Oracle数据库技术(31).
.Oracle数据库分区表操作方法.
.ORA-01034错误的解决办法.
.ORACLE DATE和TIMESTAMP数据类型.
.如何加快ORACLE本地OCI的调用速度.
.ORACLE公司倾情中国软件人才培训.
.unix----hp-ux ,trusted system .
.Oracle9i初始化参数中文说明(二.
.Linux在嵌入式系统中的应用.
.如何将EXP出来的数据IMP进不同的.
.Oracle中logmnr包的使用详解.
.Oracle10G Physical Standby Dat.

Kill Session[Metalink]

发表日期:2008-2-9



  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
  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).
  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.
  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.
上一篇:学习Oracle--Statspack分析 人气:811
下一篇:Oracle JOB 用法小结 人气:1117
浏览全部Oracle教程的内容 Dreamweaver插件下载 网页广告代码 祝你圣诞节快乐 2009年新年快乐