陈冰洁,iMC PLAT icc备份失败,提示数据库错误
1676538829,
问题描述
某局点icc自动备份/手动备份皆失败,查看失败原因提示数据库错误。
过程分析
复现问题,收集imccfgbakdm的debug日志,日志报错数据库语句执行失败:
2022-09-23 17:08:04.311 [ERROR (1205)] [THREAD(3626900336)] [CQvDBConnADP::executeSQL] Execute "update tbl_cfgbak_cfgfile_info set is_most_new = 0 where dev_id = 65831 and file_type = 0 and xrn_unit_id = -1" failed, errorMsg:Lock wait timeout exceeded; try restarting transaction
2022-09-23 17:08:04.312 [ERROR (-1)] [THREAD(3626900336)] Fail to execute update SQL in function 'CCfgFileDataMgr::addNewCfgFile'
登录后台数据库,以mysql数据库为例,进入icc_db数据库,执行下发语句报错,和日志里记录的一致,即该语句被锁住。
update tbl_cfgbak_cfgfile_info set is_most_new = 0 where dev_id = 65831 and file_type = 0 and xrn_unit_id = -1;
解决方法
参考如下百度方式,进行解锁后数据库语句执行成功,同时icc备份恢复正常。
https://blog.csdn.net/whatday/article/details/125109700