kill session V$SESSION標記為KILLED 的2種情況
If the session is not making a SQL call to Oracle (is INACTIVE) when it is
terminated, the ORA-28 message is not returned immediately. The message is not
returned until the user subsequently attempts to use the terminated session.
When an inactive session has been terminated, STATUS in the view V$SESSION is
"KILLED." The row for the terminated session is removed from V$SESSION after
the user attempts to use the session again and receives the ORA-28 message.
If an active session cannot be interrupted (for example, it is performing
network I/O or rolling back a transaction), the session cannot be terminated
until the operation completes. In this case, the session holds all resources
until it is terminated. Additionally, the session that issues the ALTER SYSTEM
statement to terminate a session waits up to 60 seconds for the session to
be terminated; if the operation that cannot be interrupted continues past
one minute, the issuer of the ALTER SYSTEM statement receives a message
indicating that the session has been "marked" to be terminated. A session
marked to be terminated is indicated in V$SESSION with a status of "KILLED"
and a server that is something other than "PSEUDO."
根據上述文件,可以理解為2種情況
1、會話沒有佔用過多的資源,不需要釋放。這種情況一旦ALTER SESSION KILLED SESSION後需要客戶端再次
發起命令返回錯誤,會話即可釋放
ERROR at line 1: ORA-00028: your session has been killed
如果不拋錯會話一直未KILLED 狀態
可以加上IMMEDIATE子句來避免這樣的問題
2、如果會話佔用過多資源,ORACLE KILLED發起者會等待60秒,如果資源不能釋放完成,那麼此會話會標記為KILLED
等待資源釋放完成。此時KILLED發起者會話將收到一個返回為會話標記為KILLED。這種情況下加入IMMEDIATE應該也是沒用的。
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7728585/viewspace-1415364/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- v$session_wait_session的等待情況及熱點塊SessionAI
- ORACLE中的KILLED SESSIONOracleSession
- Killed Session Are Not Cleaned By PMONSession
- kill sessionSession
- 【kill session】Oracle 徹底 kill session(轉載)SessionOracle
- Asp.net 2.0 Session 丟失的幾種情況ASP.NETSession
- awk -- kill sessionSession
- Oracle kill sessionOracleSession
- 【Oracle】-【SNIPED和KILLED】-SPINED和KILLED的session清理流程OracleSession
- disconnect session和kill session的區別Session
- kill session的學問Session
- kill session的測試Session
- Alter system kill session and ORA-00031: session marked for killSession
- mysql批次kill sessionMySqlSession
- alter system kill sessionSession
- Oracle kill session scriptOracleSession
- oracle_kill_sessionOracleSession
- KILL SESSION 相關Session
- Oracle中Kill sessionOracleSession
- Oracle批量kill sessionOracleSession
- disconnect session和kill session的區別 轉Session
- oracle 什麼時候才回收v$session 中status='KILLED'的程式OracleSession
- 要 kill session 例子,session多,報錯如下Session
- Oracle中Kill session的研究OracleSession
- V$SESSION記錄的BLOCKING_SESSION錯誤SessionBloC
- 監控oracle的連線(session)情況[Z]OracleSession
- 無腦批量kill sessionSession
- Oracle 徹底 kill sessionOracleSession
- 表鎖定,kill sessionSession
- Oracle中Kill session [轉]OracleSession
- 【Oracle九大效能檢視】之5.v$session_wait_session的等待情況及熱點塊OracleSessionAI
- 【Oracle】-【v$session】v$session的SNIPED狀態OracleSession
- 大話Oracle中的kill sessionOracleSession
- 檢視過去的session鎖情況指令碼Session指令碼
- 【會話】Oracle kill session系列會話OracleSession
- 【遞迴SQL】v$session--X$KSUSE s,X$KSLED e對應情況遞迴SQLSession
- V$SESSIONSession
- session和v$session說明Session