Monday, April 28, 2008

db2stop cannot stop db2 database- the database manager was not stopped because databases are still active

problem:
After running db2stop, it gives error message: the database manager was not stopped because databases are still active.

solution:
login as db2inst1,run
1. db2 list application show detail
2. db2 force application all
3. db2stop
 The database manager was not stopped because databases are still active.
4. ipclean
5. db2admin stop if you started db2admin
6. kill -9 `
ps –ef | grep db2inst1 | awk '{print "kill –9 "$2}'`
7.
ps –ef | grep db2inst1 to make sure output is nothing.

8.
ipcs –am | grep db2inst1

if any, kill them: e.g.
$ ipcrm –m 9478

9.
ipcs –as | grep db2inst1

if any , kill them also. e.g.
$ ipcrm –s 1900


10.
ipcs –aq | grep db2inst1

if any, kill them also e.g.
$ ipcrm –q 13233


11.
ipcs –a | grep db2inst1
Verify that there are no defunct interprocess

12. db2start

13.
db2admin start

14. db2 activate database abc

No comments: