Hi,
today I had problem with one query.
Even I killed session from sqlplus by command ALTER SESSION KILL, the process still running in database.
The status where killed but still consumed CPU, so I had to kill it from OS.
1. Find the problemtic query
SQL> SET LINESIZE 100
COLUMN spid FORMAT A10
COLUMN username FORMAT A10
COLUMN program FORMAT A45
SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
s.username,
s.program
FROMÂ Â gv$session s
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHEREÂ s.type != ‘BACKGROUND’ and sid=287;
INST_IDÂ Â Â Â SIDÂ Â Â Â SERIAL# SPIDÂ Â Â Â Â Â USERNAMEÂ Â PROGRAM
———- ———- ———- ———- ———- ———————————————
1Â Â Â Â 287Â Â Â Â Â 25938 18146Â Â Â Â Â Â VPTSÂ Â Â Â Â Â SQL Developer
SQL> select username, status from v$session where status=’KILLED’;
USERNAMEÂ Â STATUS
———- ——–
VPTSÂ Â Â Â Â KILLED
2. Now you can kill sessiion from OS
oracle@vserver1:~> ps -ef | grep 18146
oracle  18146    1 95 Mar15 ?       21:31:08 oracleprod (LOCAL=NO)
oracle  18418 14337 0 07:54 pts/0   00:00:00 grep 18146
oracle@vserver1:~>kill -9 18146
3. After than the process is gone
SQL> select username, status from v$session where status=’KILLED’;
no rows selected
SQL> SQL> SET LINESIZE 100
COLUMN spid FORMAT A10
COLUMN username FORMAT A10
COLUMN program FORMAT A45
SELECT s.inst_id,
s.sid,
s.serial#,
p.spid,
s.username,
s.program
FROMÂ Â gv$session s
JOIN gv$process p ON p.addr = s.paddr AND p.inst_id = s.inst_id
WHEREÂ s.type != ‘BACKGROUND’ and sid=287;
no rows selected
Regards,
Tom