问题背景:
数据库在进行大量的运算和数据处理的过程中,IO、CPU等资源消耗非常高的时候,强制停止数据库。db2stop force
结果数据库命令迟迟没有响应。这个时候对数据库进行其他操作均无响应,执行启动命令,返回SQL6036N。此时说明数据库已经hung了。
或 调试存储过程,导致数据库hung,想要通过控制中心重启下db2,结果长时间没有任何反应,再想重新连接时报错,如下
SQL6036N START 或 STOP DATABASE MANAGER 命令已在处理之中。
db2stop 命令同样会报相同的错
解决办法:
删除/home/username/sqllib/ctrl/db2strst.lck文件,默认这个文件是空的。
执行db2_kill,会提示:Application ipclean:Removing DB2 engine and client IPC resources for db2name.
重新启动db2start,查看数据库的活动状态:db2 list active databases 会显示当前活动库,这时候说明数据库已经恢复正常了。
-------------------------参考-------------------------
http://www-01.ibm.com/support/docview.wss?uid=swg21427711
Unable to start or stop db2 - DB2 is hung
Technote (troubleshooting)
Problem(Abstract)
SQL6036N: START or STOP DATABASE MANAGER command is already in progress.
Symptom
DB2 will not start or stop.
Cause
DB2 is hung.
Diagnosing the problem
SQL6036N maybe seen when issuing db2stop or db2start, or the command may hang.
Resolving the problem
In some cases, db2 will appear to be hung and will not respond to db2stop or db2start. The db2 commands will give the following message:
SQL6036N: START or STOP DATABASE MANAGER command is already in progress.
To force the db2 to shut down, open a db2 client command line window and issue:
db2_kill
Note: restarting the database or recycling the system may also resolve the issue.
Product Alias/Synonym
TSM