补充1:
根据pid找到sql语句
SELECT
sql_text,hash_value
FROM v$sqltext a
WHERE (a.hash_value, a.address) IN (
SELECT DECODE (sql_hash_value,
0, prev_hash_value,
sql_hash_value
),
DECODE (sql_hash_value, 0, prev_sql_addr, sql_address)
FROM v$session b
WHERE b.paddr = (SELECT addr
FROM v$process c
WHERE c.spid = '&pid'))
ORDER BY piece ASC
补充2:
根据pid,找到sid,serial#,再删除
select sid,serial# FROM v$session b
WHERE b.paddr = (SELECT addr
FROM v$process c
WHERE c.spid = '&pid')
ORDER BY piece ASC
说明: 这里的v$process的spid-就是top中的pid
补充3:
根据sid,serial#,找到PID=
Select c.spid from v$process c where c.addr=(select b.paddr from v$session b where b.sid= ' ' and b.serial#= ' ')