--查询锁表进程
SELECT b.owner,
b.object_name,
c.sid,
c.serial#,
a.locked_mode,
c.username,
c.logon_time,
d.SQL_TEXT
FROM v$locked_object a, dba_objects b, v$session c, v$sqltext d
WHERE b.object_id = a.object_id
AND a.session_id = c.sid
AND c.sql_hash_value = d.HASH_VALUE
ORDER BY c.logon_time;
--方法一
--alter system kill session 'sid,serial#';
alter system kill SESSION '528,4133';--503 5697 528 4133
--方法二 用于linux unix
--1.查询进程状态
SELECT Saddr, Sid, Serial#, Paddr, Username, Status
FROM V$session t
WHERE t.SID = '641';
--2.用paddr查询spid用于杀进程
select addr, pid, spid, username from v$process where addr ='000000018A43A3A0'
SELECT a.Paddr,a.sid,a.Serial#,a.Status,b.addr,b.pid,b.spid
FROM V$session a LEFT JOIN v$process b ON a.paddr=b.addr WHERE a.SID = '584';
--3.--linux unix: 杀 spid
ps -ef|grep spid 查询进程
ps -ef|grep JAVA 等
KILL -9 7471