IBM Support

db2_deinstall failed due to db2 instance entries in global.reg file not removed

Question & Answer


Question

All the instances are dropped before perform db2_deinstall, why still receive the error message of "The deinstallation process cannot continue while there are DB2 instances related to the current DB2 copy" ?

Cause

In some circumstances, db2idrop may not delete the entries of instance information in global.reg file completely which will in turn cause db2_deinstall command fail. If you run db2ilist command, you may still see the instance information in the command output.


Answer


As of db2 v97, db2 does not use profiles.reg which is under /opt/IBM/db2/v9* for storing instance information, which is only for v91 and v95. So the only way we check the db2 global registry is in global.reg file which is located in /var/db2 directory.

To resolve this issue, use the following steps if you have completed db2idrop:

1. Locate db2greg tool by cd to the install directory under bin by root.

(root@myserver) /opt/IBM/db2/V9.7/bin
# ls -l db2greg
-r-xr-xr-x 1 bin bin 120906 Jan 4 22:25 db2greg

db2greg is a tool which can be used to view and edit global.reg file.

2. Run db2greg -dump to find instance entries which should have been removed from db2idrop.

db2greg -dump |grep <dropped-instance name>

e.g. I,DB2,9.7.0.4,inst1,/home/inst1/sqllib,,1,0,/opt/db2_v97,,

inst1 is the instance name which was not removed from global.reg by db2idrop.

3. Use db2greg to delete the dropped instance entry.

db2greg -delinstrec instancename=<instance-name>

e.g. db2greg -delinstrec instancename=inst1

4. Confirm if the instance is already removed by using db2ilist

5. Rerun db2_deinstall.

[{"Product":{"code":"SSEPGG","label":"Db2 for Linux, UNIX and Windows"},"Business Unit":{"code":"BU058","label":"IBM Infrastructure w\/TPS"},"Component":"Database Objects\/Config - Env variables\/reg variables\/db2greg","Platform":[{"code":"PF002","label":"AIX"},{"code":"PF010","label":"HP-UX"},{"code":"PF016","label":"Linux"}],"Version":"9.7","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
16 June 2018

UID

swg21577282