1、
-- 查询会话ID
select username,sid,serial# from v$session;
-- 查询spid
select pro.spid
from v$session ses,v$process pro where ses.sid=xxx and ses.paddr=pro.addr;
-- 查询会话对应sql
SELECT SE.sid,
SE.serial#,
PR.spid,
SE.status,
SUBSTR(SE.program, 1, 10) PROG,
SUBSTR(SE.machine, 1, 10) MACH,
SQ.sql_text
FROM v$session SE, v$sqlarea SQ, v$process PR
WHERE SE.paddr = PR.ADDR(+)
AND SE.sql_address = SQ.address(+)
AND schemaname <> 'SYS'
ORDER BY SE.sid
-- 杀掉spid
kill -9 spid
select * from v$access o where o.OBJECT like 'XXWPF007%'
select * from v$session a WHERE A.SID=sid
alter system kill session 'sid,serial#'