Uninstalling DB2 for Windows

Technote (FAQ)


Question

How to uninstall and remove DB2 from Windows

Answer

There are four methods of removing DB2 for Windows. The primary option of uninstalling DB2 should be the ONLY option attempted. The subsequent methods should only be attempted after the DB2 Service team has been contacted and determined that the uninstallation through the primary method cannot be remedied.
The four uninstallation techniques are outlined below in order of preference.

PRIMARY UNINSTALL OPTION

1) Control Panel - Add/Remove Programs

Uninstalling through the Add/Remove Programs facility of the Windows Control Panel is the preferred method. Depending on the specific Windows platform, the DB2 product in Add/Remove Programs may have a "Remove" and/or "Change" button. Either of these options can be used for removal purposes.

At the first screen of the DB2 uninstallation process, the Next button is grayed out while Windows Installer performs various functions in the background to ensure that DB2 is prepared to be uninstalled. Once the Windows Installer is ready to proceed, the Next button will be enabled and the user can proceed. In the event that the uninstallation fails, the user should contact the service team to receive instructions for taking an uninstallation log and trace to determine the cause of the problem.

TROUBLESHOOTING UNINSTALL OPTIONS ONLY

The following Uninstall options should ONLY be attempted if the Primary Option fails.

2) Running SETUP from the original source

Unfortunately, DB2 can’t always be removed by using the Control Panel’s Add/Remove Programs facility. In this situation, the first action that should be attempted is to run 'setup' from the original install source location (either CD or network drive).

Remember to make sure that it is the same DB2 product (ie. ESE, ADMCL, WSE, etc.) and level (ie. GA, FP2, V9.7, etc.) as the DB2 product installed. Windows Installer should recognize that it is already installed, and present you with three options - Repair, Modify and Remove. Simply click the radio button REMOVE and continue, to remove product.

Another possible problem is if Windows Installer asks for the original .msi file. In this case, the original install source should be pointed to, and the .msi file should be selected from [source]\db2\Windows\[DB2 product].msi.

3) Using FORCE_UNINSTALL

The inability to remove DB2 can also be the result of a number of factors, such as user tampering with the system registry, DB2 files, or directory structure. In this situation, the FORCE_UNINSTALL uninstallation method should be attempted to remove DB2 if the methods above are unsuccessful.

This uninstallation option combines the use of the msiexec Windows Installer function with manual cleanup procedures. To carry out the uninstall using this method:

  1. Stop all DB2 Services.
  2. From a Windows Command Window navigate to the windows Installer directory such as c:\Windows\Installer or c:\WinNT\Installer and execute the following:

    msiexec /x {product code} FORCE_UNINSTALL=Y

    {product code} can be located from the Windows registry under one of the following locations depending if you have a single or multiple product installation:

    HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\<Product>\CurrentVersion
    HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\InstalledCopies\<Copy Name>\<Product>\CurrentVersion

    Examples:
    HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\DB2 Enterprise Server Edition\CurrentVersion
    HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\InstalledCopies\DB2COPY1\DB2 Workgroup Server Edition\CurrentVersion

    Using DB2 ESE v9.7 as an example the command syntax would be as follows:

    msiexec /x {814D6DAC-E778-40EC-961E-312B354D12BC} FORCE_UNINSTALL=Y

    If this command does not complete then proceed to the Manual Uninstallation section below. Otherwise, continue on with the following steps:
  3. Perform Windows Environment cleanup (refer to DB2 Environment Variables Clean-up section below).
  4. Perform Windows Registry Cleanup (refer to DB2 Windows Registry Clean-up section below).
  5. Remove any DB2 Service entries from the Windows System Services file ([Windows]\system32\drivers\etc).
  6. Remove the SQLLIB directory.
  7. Remove DB2 shortcuts.

    Look for the “IBM DB2” shortcut folder, in the 'All Users' profiles in the ‘Start Menu/Programs’ folder, and delete it.
    Then delete any DB2 links in the ‘Startup’ folder (such as “First Steps”).

4) Manual Removal and Clean-up of DB2 from Windows

The following procedure can be used if there is a severe problem with DB2 uninstallation caused by a Windows Installer error and the FORCE_UNINSTALL option does not help.

Steps to manually remove a DB2 product is as follows:
  1. Stop all DB2 Services.
  2. Remove the SQLLIB directory.
  3. Remove all shortcuts and folders.
  4. Remove all updates to Windows environment variables (refer to DB2 Environment Variables Clean-up section below).
  5. Remove DB2 references from the Windows Registry (refer to DB2 Windows Registry Clean-up section below).
  6. Restart Windows.

DB2 Environment Variables Clean-up

From Control Panel navigate to My Computer -> Properties -> Advanced -> Environment Variables and remove any DB2 specific listed environment variables as well any any references to the DB2 install directory from the following:

LIB
PATH
INCLUDE
CLASSPATH

DB2 Windows Registry Clean-up

First create a backup of the Windows Registry before modifying any settings as changes made to the registry will have an immediate impact. Then identify the { product code} and {registry key} for the target DB2 installation that is to be removed.

The { product code} can be located from the Windows registry under one of the following locations depending if you have a single or multiple product installation:

HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\<Product>\CurrentVersion
HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\InstalledCopies\<Copy Name>\<Product>\CurrentVersion

The {registry key} is derived from the { product code} by reversing the first three segments of the product code.

Example: ProductCode for DB2 ESE v9.7 is {814D6DAC-E778-40EC-961E-312B354D12BC}

Reverse the first 3 segments individually (CAD6D418-877E-CE04), remove all dashes, and we are left with the following key:

CAD6D418877ECE0469E113B253D421CB

Now that we have the { product code} and {registry key} proceed to:
  1. Delete the following:

    HKEY_LOCAL_MACHINE\Software\Classes\Installer\Features\{registry key}
    HKEY_LOCAL_MACHINE\Software\Classes\Installer\Products\{registry key}
    HKEY_LOCAL_MACHINE\Software\Classes\Installer\UpgradeCodes\{registry key}
  2. Remove all DB2 services under:

    HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services
  3. Remove any folder names containing sqllib under:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\Folders
  4. For DB2 v8.2, all components that start with 000182B and need to be deleted from:

    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Components
  5. Finally delete the following entries:

    HKEY_LOCAL_MACHINE\Software\IBM\DB2
    HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall\{product code}




For further discussion on this topic, visit this developerWorks forum thread:
https://www.ibm.com/developerworks/community/forums/html/topic?id=f618b308-1373-48d3-964f-d26ce110b405

Rate this page:

(0 users)Average rating

Document information


More support for:

DB2 for Linux, UNIX and Windows

Software version:

8.2, 9.1, 9.5, 9.7, 10.1, 10.5

Operating system(s):

Windows

Software edition:

All Editions

Reference #:

1104569

Modified date:

2005-02-04

Translate my page

Machine Translation

Content navigation