Oracle查看和终止正在执行的SQL语句
--查询当前用户正在执行的SQL语句
select a.sid,a.serial#,a.paddr,a.machine,nvl(a.sql_id, a.prev_sql_id) sql_id,
b.sql_text,b.sql_fulltext,b.executions,b.first_load_time,
b.last_load_time,b.last_active_time,b.disk_reads,b.direct_writes,b.buffer_gets
from v$sql b
inner join v$session a on nvl(a.sql_id, a.prev_sql_id) = b.sql_id
where a.username = sys_context('USERENV', 'CURRENT_USER')
and a.status = 'ACTIVE'
--强制终止sql查询语句的执行,上SQL返回的前2列
alter system kill session(sid,serial#)