SELECT object_name, machine, s.sid, s.serial# FROM gv$locked_object l, dba_objects o, gv$session s WHERE l.object_id = o.object_id AND l.session_id = s.sid;
如果没有结果就是没有被锁定的,如果查询有结果,就说明此表被锁了。如图: