关于数据库表update时被锁问题
关于数据库表update时被锁问题
在往表中插入数据时,插入不进去,表被锁住了,如何查询是否表被锁呢?
我的笔记: www.zzzyk.com
查询表被锁信息:
select sess.sid,
sess.serial#,
lo.oracle_username,
lo.os_user_name,
ao.object_name,
lo.locked_mode
from v$locked_object lo, dba_objects ao, v$session sess
where ao.object_id = lo.object_id
and lo.session_id = sess.sid;
select sess.sid,
sess.serial#,
lo.oracle_username,
lo.os_user_name,
ao.object_name,
lo.locked_mode,
ao.owner,
ao.object_name,
ao.object_type
from v$locked_object lo, dba_objects ao, v$session sess
where ao.object_id = lo.object_id
and lo.session_id = sess.sid;
alter system kill session 'sid,serial#';