2018年5月23日 星期三

oracle db session lock

--判斷是否有Session Lock,觀察seconds_in_wait秒數是否過長 select (select count(1) from v$session a2 where a2.blocking_session is not NULL and a2.sid=a1.blocking_session ) r_count, a1.blocking_session, ( select a2.serial# from v$session a2 where a2.sid= a1.blocking_session ) blocking_serial, a1.sid, a1.serial#, a1.wait_class, a1.module, a1.seconds_in_wait, a1.action from v$session a1 where a1.blocking_session is not NULL And a1. blocking_session<>1693 order by 1; --確認Lock Session是不是在Inactive狀態 --WAY2 select sid,serial#,module,action,status,event,seconds_in_wait,logon_time,osuser,process,SYSDATE - (last_call_et / 86400) "Last_Call" from v$session where sid=2851; --刪除Lock Session alter system kill session 'SID,SERIAL#';

沒有留言:

張貼留言