Removing Sessions in Killed Status on Unix (文件 ID 274216.1)
PURPOSE
=======
This article explains how to get rid of idle sessions. Even when we kill idle
sessions from the database, they remain in "killed" status and are accounted for
the total sessions/processes initialization parameter.
PREFACE
=======
Sometimes we find orphan server processes which will never disappear. They are
listed in v$session. Because of a non-existent user process, the server process
stays in the server waiting for the user process to be touched once, which will
never happen. Orphan processes are created after killing them from the database
side using:
ALTER SYSTEM KILL SESSION 'sid,serial#'; command.
As a result, the session count reaches the sessions parameter and may throw
an error like ORA-00018.
PROCEDURE
=========
Before killing a session, we can query v$session to get the session details.
SELECT sid, serial#, username, process,machine, terminal, program,
osuser, logon_time, last_call_et
FROM v$session
WHERE username IS NOT NULL
AND status != 'ACTIVE'
ORDER BY last_call_et
/
The last_call_et column will have the time in seconds since the session has done
some work (SELECT / DML / DDL etc.)
From this, we know how many hours or days a session has been idle.
Before killing the session from the database, we should find the OS process id
using the following query:
SELECT s.sid, s.serial#, p.spid
FROM v$session s,v$process p
WHERE s.paddr = p.addr
/
o First we can kill the sessions from the database using the sid and serial#
o If after sometime they stay in the database (v$session.status = 'KILLED'),
then we have to kill them from OS with:
kill -9 <spid>
NOTE:
=====
Killing a background process will terminate the instance.
We can cross check the OS process from the OS:
ps -ef|grep <spid> would give something like:
(DESCRIPTION=(LOCAL=YES)(ADDRESS=(PROTOCOL=beq)))
for a server process.
For a background process it would give:
ora_pmon_isc817
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/20747382/viewspace-2131007/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- Sessions Get Killed if Connection Use Default Service name (Same as db_name) (Doc ID 730315.1)Session
- monitor PX limits from Resource Manager for active sessions (文件 ID 240877.1)MITSession
- oracle 什麼時候才回收v$session 中status='KILLED'的程式OracleSession
- [20200319]KILL STATUS ='KILLED'的程式.txt
- How To Automate Disconnection of Idle SessionsSession
- 【Oracle】-【SNIPED和KILLED】-SPINED和KILLED的session清理流程OracleSession
- Kill SessionsSession
- Killed Session Are Not Cleaned By PMONSession
- SESSIONS, PROCESSES, TRANSACTIONSSession
- Sessions & Processes parameterSession
- limit active sessionsMITSession
- ORACLE中的KILLED SESSIONOracleSession
- Removing a Node from a 10gR1 RAC Cluster (Doc ID 269320.1)REM
- v$sql.object_status=INVALID_UNAUTHSQLObject
- patch_id,version, action ,status,action_time,description
- UNIX檔案的SUID/SGID(轉)UI
- ulimit限制導致的 +++ killed by SIGKILL +++MIT
- 會話控制利器 gorilla/sessions會話GoSession
- Inhomogeneous deployment for replicated sessions is not allowed.Session
- How to get complete sessions informationSessionORM
- sessions,processes的監控方法Session
- Kill all sessions of a specified user nameSession
- Connections and Sessions (110)Session
- 解決Android 虛擬機器執行The emulator process for AVD was killed.錯誤。Android虛擬機
- In V$SESSION, column SQL_ID is not NULL while STATUS is INACTIVESessionSQLNullWhile
- Error bpbrm (pid=909384) client restore EXIT STATUS 5ErrorclientREST
- Support Status - Oracle Database on Linux Itanium [ID 1130325.1]OracleDatabaseLinux
- V$SESSION.STATUS='ACTIVE' AND WAIT_EVENT='Idle'SessionAI
- 使用apidoc文件神器,快速生成api文件API
- git status 命令Git
- SUID and SGID: -rwsr-xr-x Unix file permissionUI
- Physical Standby Switchover_status Showing Not Allowed. (Doc ID 1392763.1)
- How to Recreate the OraInventory on UNIX Systems [ID 472854.1]AI
- MPAndroidChart文件翻譯Android
- Linux下Python程式Killed,分析其原因LinuxPython
- oracle profile sessions_per_user的用法OracleSession
- sessions 與 processes 的計算關係Session
- “tar: Removing leading `/’ from member names”的錯誤REM