国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁 > 開發 > 綜合 > 正文

Kill Session[Metalink]

2024-07-21 02:38:01
字體:
來源:轉載
供稿:網友

  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.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 东源县| 丰顺县| 岳西县| 蓬莱市| 玛曲县| 东丰县| 东明县| 介休市| 富蕴县| 互助| 孟州市| 瑞丽市| 阿合奇县| 南华县| 资源县| 施甸县| 二手房| 门头沟区| 江阴市| 阿克苏市| 江永县| 梅河口市| 深州市| 西林县| 五华县| 宕昌县| 海林市| 当阳市| 清涧县| 敖汉旗| 巢湖市| 松阳县| 东山县| 芷江| 景东| 叙永县| 苏州市| 吉安市| 毕节市| 邳州市| 嘉兴市|