转载地址:https://blog.csdn.net/cicon/article/details/68068462##一.postgresql解决锁表--查询是否锁表了select oid from pg_class where relname='可能锁表了的表'select pid from pg_locks where relation='上面查出的oid'--如果查询到了结果,表示该表被锁 则需要释放锁定select pg_cancel_backend(上面查到的pid) 12345 二.…
--查询是否锁表了select oid from pg_class where relname='可能锁表了的表'select pid from pg_locks where relation='上面查出的oid'--如果查询到了结果,表示该表被锁 则需要释放锁定select pg_cancel_backend(上面查到的pid)…
--以下几个为相关表SELECT * FROM v$lock;SELECT * FROM v$sqlarea;SELECT * FROM v$session;SELECT * FROM v$process ;SELECT * FROM v$locked_object;SELECT * FROM all_objects;SELECT * FROM v$session_wait; --查看被锁的表 select b.owner,b.object_name,a.session_id,a.locked_…