Stop DB2 Instance


Steps to Stop DB2 Instance

1) Swith User to the Db2 Instance User
2) Check if the db2 process is running using the “ps -ef | grep db2sys” where db2sysc is the DB2 engine (instance)
3) Execute “db2stop”
4) Check once again for the db2sys process

[root@mercury instance]# su – db2inst1[db2inst1@mercury ~]$ ps -ef | grep db2sys
db2inst1 10850 10849 0 May23 pts/7 00:00:01 db2sysc 0
db2inst1 11222 11135 0 00:10 pts/7 00:00:00 grep db2sys

[db2inst1@mercury ~]$ db2stop
05/24/2011 00:11:07 0 0 SQL1064N DB2STOP processing was successful.
SQL1064N DB2STOP processing was successful.

[db2inst1@mercury ~]$ ps -ef | grep db2sys

 

Screenshot: db2stop Command

db2start

5) Check the db2diag.logs for any errors

If while stopping the db2instance we get the following message ” the DataBase Manager cannot be stopped because the database is still active”
This would mean there are still some connections using the DB

so we have to force the applications to close

1) Use list applications to display the details
.

[db2inst1@mercury dbbackup]$ db2 list applications

 

2) Force the applications to close

[db2inst1@mercury dbbackup]$ db2 force applications all

3) Then execute the “db2stop” command

[db2inst1@mercury dbbackup]$ db2stop

Screenshot: db2stop Command

 

Leave a Reply

Your email address will not be published. Required fields are marked *