sql执行时间太久,要kill
1.oracle查询正在执行的sql
SELECT b.sid oracleID,
b.username 登录Oracle用户名,
b.serial#,
spid 操作系统ID,
paddr,
sql_text 正在执行的SQL,
b.machine 计算机名
FROM v$process a, v$session b, v$sqlarea c
WHERE a.addr = b.paddr
AND b.sql_hash_value = c.hash_value
2.查询oracle当前被锁对象
select a.session_id, c.serial#, a.locked_mode, a.oracle_username, a.os_user_name, c.machine,
c.terminal, b.object_name, c.logon_time
from v$locked_object a, all_objects b, v$session c
where a.object_id = b.object_id and a.session_id = c.sid
order by c.sid, c.serial#;
alter system kill session 'sid, s.serial#‘;