In another session, select some values related to the session and its associated process:
select
ses.status,
ses.paddr,
prc.pid,
prc.spid
from
v$session ses left join
v$process prc on ses.paddr = prc.addr
where
ses.sid = 130 and
ses.serial# = 1684;
--
-- STATUS PADDR PID SPID
-- -------- ---------------- ---------- ------------------------
-- INACTIVE 00000000945DC598 85 5156
Still in the same session: kill the demonstration session:
alter system kill session '130,1684';
--
-- System KILL altered
Check the session data again:
select
ses.status,
ses.paddr,
prc.pid,
prc.spid
from
v$session ses left join
v$process prc on ses.paddr = prc.addr
where
ses.sid = 130 and
ses.serial# = 1684;
--
-- STATUS PADDR PID SPID
-- -------- ---------------- ---------- ------------------------
-- KILLED 00000000945DC598
The session is still here and marked as KILLED, but the process is gone (i. e. select * from v$process where addr = '00000000945DC598' returns nothing).
The demonstration session remains as KILLED until another statement is executed in it which gives Oracle an occasion to notify the user that the session is killed:
After delivering this notification, the session record is also gone in v$session, i. e. select * from v$session where sid = 130 and serial# = 1684 returns nothing.
ALTER SYSTEM KILL SESSION … FORCE
Similar to above, this time, a session is killed with the FORCE attribute:
alter system kill session '130,4712' FORCE;
--
-- System KILL altered.
With this approach, the entry in v$session disappears without delivering ORA-00028 to the user.
The nex statement entered in the «demonstration» session is answered like so: