国产探花免费观看_亚洲丰满少妇自慰呻吟_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.

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
主站蜘蛛池模板: 商水县| 宝清县| 台湾省| 贵溪市| 大连市| 自治县| 彩票| 凤城市| 安塞县| 梓潼县| 黄山市| 龙胜| 哈密市| 关岭| 元江| 会同县| 林口县| 灵武市| 云梦县| 临邑县| 滨海县| 焉耆| 来凤县| 昌都县| 那曲县| 元朗区| 五原县| 建昌县| 富蕴县| 织金县| 永善县| 芦溪县| 大庆市| 江油市| 本溪| 赤峰市| 新郑市| 隆德县| 色达县| 临沧市| 色达县|