DB2 锁表 线程等问题 求高手来解答
如何查询锁表?如何解锁? 还有2个线程对一个表同时进行修改会出现锁表吗?如果出现该如何解决呢?
[解决办法]
1.查锁:(可以查到哪个用户把哪个表锁了)
SELECT p.spid ,
decode(locked_mode,0,'None',1,'Null',2,'Row share',
3,'Row Exclusive',4,'Share',5,'Share Row Exclusive',6,'Exclusive') lock_type,
c.object_name ,
b.session_id ,
b.oracle_username,
b.os_user_name,
b.locked_mode,
a.sid,
a.serial#,
a.machine,
a.action,
to_char(a.logon_time,'yyyy/mm/dd hh24:mi')
FROM v$process p,
v$session a ,
v$locked_object b,
all_objects c
WHERE p.addr =a.paddr
AND a.process =b.process
AND c.object_id=b.object_id