为提高效率,提问时请提供以下信息,问题描述清晰可优先响应。
【DM版本】:
【操作系统】:
【CPU】:
【问题描述】*:
如图所示这阻塞的update为什么不能能执行了,如何能解决这个问题?
第一条完整信息
2025-03-21 17:30:36 1563 被阻塞的信息 139844676757712 update T_JYGL_JYSB_QR set fdstate='0',yqrr='Yangyandx',yqrtime='2025-03-21 17:05:12.308' where to_char(creattime,'yyyy-mm-dd hh24:mi:ss.ff3')='2025-03-21 12:16:30.569' and to_char(sbsj,'yyyy-mm-dd hh24:mi:ss.ff3') ='2025-01-09 05:38:58.818' and pseqid='1900522412512538626' and seqid='187544379518029005004' and month='2025-04'; ACTIVE 14080371203 NMJY ::ffff:10.126.243.26 2025-03-21 17:04:33.000000 引起阻塞的信息 139873451504064 update T_JYGL_JYSB_QR set fdstate='0',yqrr='Jzjy',yqrtime='2025-03-21 17:21:38.998' where to_char(creattime,'yyyy-mm-dd hh24:mi:ss.ff3')='2025-03-20 18:53:11.560' and to_char(sbsj,'yyyy-mm-dd hh24:mi:ss.ff3') ='2025-01-09 05:14:29.481' and pseqid='1900522412512538626' and seqid='187544379518029005004' and month='2025-04'; ACTIVE 14078055896 NMJY ::ffff:10.126.243.26 2025-03-21 17:21:00.000000
另一条sql
这里阻塞的sql和引起sql的阻塞不是同一条sql。
2025-03-21 17:30:36 804 被阻塞的信息 139846225541984 update T_JYGL_QR set fdstate='1',fqrr='xxx',fqrtime='2025-03-21 17:17:50.903' where to_char(creattime,'yyyy-mm-dd hh24:mi:ss.ff3')='2025-03-21 12:18:14.701' and to_char(sbsj,'yyyy-mm-dd hh24:mi:ss.ff3') ='2025-01-09 05:37:20.553' and pseqid='190 ' and seqid='187 ' and month='2025-04'; ACTIVE 14081147503 NMJY ::ffff:10.126.243.26 2025-03-21 17:17:12.000000 引起阻塞的信息 139873252834320 update T2 set cjl=?, cost=?,price=? where pdate=? and bidsign='11' and seqid='187544379518029005004' and fddyid='FH123' and yddyid='YH0471' and to_char(sbsj,'yyyy-mm-dd hh24:mi:ss.ff3') ='2025-01-09 04:06:37.787'; ACTIVE 14080138025 NMJY ::ffff:10.126.243.26 2025-03-21 17:29:29.000000
是因为2个sql属于同一个事务引起的吗?
这样查到的只是阻塞会话当前执行的SQL,大概率之前还执行过其他SQL,没有提交的原因。
管理工具里是不是其他连接做了update修改没有提交,dml语操作要提交的。
管理工具这里进行提交
1、第一个SQL没有提交导致后面的SQL阻塞。
2、第一个SQL执行时间较长,需要排队等待。
是不是不同事物修改同一条数据后没有做提交,dml操作完都需要commit