oracle session locked

列出停滯的使用者session

select * from v$session where username=’xxx’
and last_call_et > 65000

delete v$session where sid=9

select  * from v$lock

SELECT s.sid,
s.serial#,
s.osuser,
s.program
FROM   v$session s
where username=’xxx’ and last_call_et > 65000;

刪除session

ALTER SYSTEM KILL SESSION ‘9,43728’ IMMEDIATE;
ALTER SYSTEM KILL SESSION ‘14,22737’ IMMEDIATE;

SELECT ‘ALTER SYSTEM KILL SESSION “‘ || s.sid ||
‘,’ || s.serial# || “‘ IMMEDIATE;’
FROM   v$session s
where username=’xxx’ and last_call_et > 65000;