Kill Database Session
Alert Format
? User requested to kill session.
Action
1. If an Incident ticket is open with SID which needs to be killed. Check SID, serial #, username, Operating System Process ID, type for that process. Ask any relevant questions like database username, terminal, osuser, whenever necessary. Use below queries to find out details.
Select s.sid,s,serial#, s.username, s.terminal, p.spid, s.type from v$session s, v$process p
where p.addr=s.paddr and s.sid in (‘$SIDID1’, ‘SIDID2’ … )
2. Ensure that 'TYPE' should not be shown as 'BACKGROUND' in above sql output. Do not kill session with type as 'BACKGROUND' otherwise database will be down. Inform Application team that you can’t kill this session. Escalate to Global Oracle DBA team.
3. If an Incident ticket is open to kill all sessions which are either active or inactive then forward a list of sessions to the requester so that they can verify exactly what sessions are going to be killed.
4. Kill the session using ‘Alter System Kill Session ‘SID,SERIAL#’; command.
5. Verify that the session is killed and respective Operating System process id also removed. If required, Kill respective operating system process using Kill -9 < SPID >
6. Check if session is rolling back uncommitted data– when notifying user that session is killed, ensure they are aware that it may take some time before locks etc are released ( this will avoid repeat follow up calls if user is waiting for any locked resources to be released.) (Use v$transaction).
7. Close the Incident ticket