Oracle鎖表處理

2021-06-16 14:07:35 字數 664 閱讀 8808

1、查詢出被鎖的表的session_id,和serial#。

select l.session_id sid, s.serial#, l.locked_mode,l.oracle_username,

l.os_user_name,s.machine, s.terminal, o.object_name, s.logon_time

from v$locked_object l, all_objects o, v$session s

where l.object_id = o.object_id

and l.session_id = s.sid

order by sid, s.serial# ;

2、kill session

alter system kill session 'aaa,bbb' -- 其中aaa是上面查詢出的sid,bbb是serial#的值

3、一般上兩個步驟就搞定鎖表了,如果殺不掉,就進入到os級別殺......

select spid, osuser, s.program

from v$session s,v$process p

where s.paddr=p.addr and s.sid=24 (24是上面的sid)

linux下 kill -9 12345(12345為上邊查詢出的spid)

oracle鎖表處理

1 select from v locked object 查出被鎖定的物件,其中object id是物件的id,session id是被鎖定物件有session id 2 select object name,object type from dba objects where object id...

Oracle表鎖死處理

查詢被鎖的表 select from v session where sid in select lockobj.session id from v locked object lockobj left join dba objects objs on lockobj.object id objs....

oracle的鎖表及處理

1.執行一下sql,查詢出被鎖表的session和serial select b.username,b.sid,b.serial logon time from v locked object a,v session b where a.session id b.sid order by b.log...