select object_name,session_id,os_user_name,Oracle_username,process,locked_mode,status from v$locked_object l, all_objects a where l.object_id=a.object_id;
在Oracle中查询锁表及解锁:
锁表查询的代码有以下的形式:
select count(*) from v$locked_object;
select * from v$locked_object;
查看哪个表被锁:
select b.owner,b.object_name,a.session_id,a.locked_mode from v$locked_object a,dba_objects b where b.object_id = a.object_id;
查看是哪个session