最近做项目,遇到了更新超时的问题,反复检查数据都正常,纳闷完了忽然想到是不是表被锁定了,一看果然,解决办法如下:
--锁表查询语句
SELECT object_name, machine, s.sid, s.serial#,s.sid||','||s.serial# str
FROM gv$locked_object l, dba_objects o, gv$session s
WHERE l.object_id = o.object_id
AND l.session_id = s.sid; --杀掉进程 sid,serial#
--alter system kill session 'sid,seial#';
ALTER system kill session '132,1706';
查看语句命令执行记录
SELECT SQL_TEXT, LAST_ACTIVE_TIME,SQL_FULLTEXT FROM v$sql ORDER BY LAST_ACTIVE_TIME DESC; SELECT * FROM v$sql ORDER BY LAST_ACTIVE_TIME DESC;
--参考文章
https://www.cnblogs.com/XQiu/p/5212787.html