oracle锁解决.txt

      随便 2005-3-29 11:52
--查看死锁列表
select l.session_id sid,
l.locked_mode lockmode,
l.oracle_username db_user,
l.os_user_name os_user,
s.machine,
s.schemaname,
o.object_name tablename,
q.sql_text
from v$locked_object l, v$session s, v$sql q, all_objects o
where l.session_id=s.sid and
s.type='USER' and
s.sql_address=q.address and
l.object_id=o.object_id


2 row share
3 row ex
4 table share
5 s/row-ssx
6 ex
    
--获取造成死锁的进程号    
SELECT sid, serial#, username, osuser FROM v$session where sid =14;

--杀死死锁会话进程    
alter system kill session '42,49508'

--获取死锁系统进程号
select spid from v$process
where addr=(select paddr from v$session where sid=42 and serial#=49508);
--杀死Unix进程(非SQL命令)
kill -9 spid

--查看进程当前状态
select status from v$session where sid =42
标签集:TAGS:
回复Comments() 点击Count()

回复Comments

{commentauthor}
{commentauthor}
{commenttime}
{commentnum}
{commentcontent}
作者:
{commentrecontent}