Killed Session Are Not Cleaned By PMON
In this Document
APPLIES TO:
Oracle Database - Enterprise Edition - Version 9.2.0.1 and laterInformation in this document applies to any platform.
SYMPTOMS
Due to application design, database has some inactive sessions remaining in database. When these sessions are killed manually in the database using alter system and killed at OS level using kill -9 as well , sessions still remain in database (v$session) . OS session goes away but database session does not.
Patch 16494960 does not resolve the problem.
CAUSE
The session being killed is part of a global transaction with other related sessions still alive (marked for KILL or showing session marked for KILLED)
As per output from:
select taddr, status, sid, serial#, LAST_CALL_ET from v$session
where taddr in
( select taddr from v$session where status='KILLED' )
order by 1,2 desc ,3
;
SOLUTION
> Query to identify different branches and related SIDs of an XA transaction
-> You will find example SQLs in note 1248848.1 and note 332326.1
For attached transaction branches all sessions attached to the same transaction in tightly coupled mode will have the same "V$SESSION.TADDR" so for this scenario you can use something like this:
select xidusn||'.'||xidslot||'.'||xidsqn XID,
sid,serial#,username, s.status
from v$session s , v$transaction t
where s.taddr=t.addr
order by 1,2;
However once you get detached branches things can get more complicated. The "get_xa_status.sql" in doc 1248848.1 gives a reasonable basis for finding information.
-> When you have tightly coupled branches of a global transaction then resources may be owned by the transaction itself, not directly by the session. Killing just one session of a multi-branch transaction does not remove the other branches / sessions. If the other session makes a call it should get an error to tell it that some other branch of the transaction failed.
ie: killing just one session of a multi-branch transaction cannot release resources owned by the transaction itself.
Those resources are only freed when the transaction itself is cleaned up - ie when the last session/branch completes (or is killed).
REFERENCES
NOTE:16494960.8 - Bug 16494960 - killed session not being cleaned upNOTE:332326.1 - How to identify a session started by a remote distributed transaction?
NOTE:274216.1 - Removing Sessions in Killed Status on Unix
NOTE:752676.1 - Session Marked As Killed But Continues To Consume 100% CPU
NOTE:159377.1 - How to Purge a Distributed Transaction from a Database
NOTE:1248848.1 - Solving locking problems in a XA environment
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20747382/viewspace-2131005/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- ORACLE中的KILLED SESSIONOracleSession
- 【Oracle】-【SNIPED和KILLED】-SPINED和KILLED的session清理流程OracleSession
- kill session V$SESSION標記為KILLED 的2種情況Session
- SESSION處於KILLED狀態下如何找出對應的程式Session
- oracle 什麼時候才回收v$session 中status='KILLED'的程式OracleSession
- PMON failed to acquire latch, see PMON dumpAIUI
- PMON failed to acquire latch, see PMON dump in alert logAIUI
- 'PMON failed to acquire latch, see PMON dump' in Alert Log-976714.1AIUI
- Process Monitor Process (PMON) (121)
- 資料庫關閉Hang住,出現錯誤PMON failed to acquire latch, see PMON dump資料庫AIUI
- ulimit限制導致的 +++ killed by SIGKILL +++MIT
- Bug 4632780 - PMON "failed to acquire latch" during shutdownAIUI
- oracle smon與pmon ckpt功能的作用(ZT)Oracle
- PMON "failed to acquire latch" during shutdown-4632780.8AIUI
- Linux下Python程式Killed,分析其原因LinuxPython
- Removing Sessions in Killed Status on Unix (文件 ID 274216.1)REMSession
- oracle 11g pmon工作內容系列一Oracle
- oracle 11g pmon工作內容系列二Oracle
- oracle 11g pmon工作內容系列三Oracle
- 【RAC】PMON: terminating the instance due to error 481Error
- 錯誤解決:cc: Internal error: Killed (program cc1)Error
- 詳解 Flink 容器化環境下的 OOM KilledOOM
- PMON、SMON、DBWn、LGWR、CKPT、ARCH等後臺程式說明
- oracle 的伺服器程式(PMON, SMON,CKPT,DBWn,LGWR,ARCn)Oracle伺服器
- 關閉資料庫出現PMON failed to acquire latch資訊資料庫AIUI
- 關於pmon、smon、mman、mmon、mmnl後臺程式的解釋
- laravel session 與 php session配置LaravelSessionPHP
- session和v$session說明Session
- memcached-session-manager session共享Session
- SessionSession
- Fails to Start: PMON (ospid: nnnn): terminating the instance due to error 481AIError
- ksuapc : ORA-1033 foreground process starts before PMON處理
- Session分散式共享 = Session + Redis + NginxSession分散式RedisNginx
- session bean中的session如何理解?SessionBean
- [20200319]KILL STATUS ='KILLED'的程式.txt
- 玩轉跟蹤(to owner session、other session)Session
- PMON TRYING TO START CJQ0 DURING DATABASE SHUTDOWN-ORA-443&ORA-450Database
- session switchSession