DB2 10.5 for Linux, UNIX, and Windows

Uninstalling your DB2 database product (Windows)

This task provides steps for completely removing your DB2® database product from your Windows operating system. Only perform this task if you no longer require your existing DB2 instances and databases.

About this task

If you are uninstalling the default DB2 copy, and you have other DB2 copies on your system, use the db2swtch command to choose a new default copy before you proceed with the uninstallation. Also, if your DB2 Administration Server (DAS) is running under the copy being removed, move your DAS to a copy that is not being removed. Otherwise, re-create the DAS using the db2admin create command after the uninstall, and you reconfigure the DAS for some function to work.

Procedure

To remove your DB2 database product from Windows:

  1. Optional: Drop all databases using the drop database command. Be sure that you no longer need these databases. If you drop your databases, all of your data will be gone.
  2. Required: If your DB2 instance is configured for HA with Microsoft Cluster Server (MSCS), you need to decluster the instance before you uninstall your DB2 product by running the db2mscs -u instance-name command.
  3. Stop all DB2 processes and services. This can be done through the Windows Services panel or by issuing the db2stop command. If DB2 services and processes are not stopped before attempting to remove your DB2 database product, you will receive a warning containing a list of processes and services that are holding DB2 DLLs in memory. If you will use Add/Remove Programs to remove your DB2 database product, this step is optional.
  4. You have two options for removing your DB2 database product:
    • Add/Remove Programs

      Accessible through the Windows Control Panel, use the Add/Remove Programs window to remove your DB2 database product. Refer to your operating system's help for more information about removing software products from your Windows operating system.

    • db2unins command

      You can run the db2unins command from the DB2DIR\bin directory to remove your DB2 database products, features, or languages. Using this command, you can uninstall multiple DB2 database products at the same time using the /p parameter. You can use a response file to uninstall DB2 database products, features, or languages using /u parameter.

What to do next

Unfortunately, your DB2 database product cannot always be removed by using the Control Panel > Add/Remove Programs facility or using the db2unins /p command or the db2unins /u command. The following uninstallation option must ONLY be attempted if the previous method fails.

To forcefully remove all DB2 copies from your Windows system, run the db2unins /f command. This command will perform a brute force uninstallation of ALL DB2 copies on the system. Everything except user data, such as DB2 databases, will be forcefully deleted. Before running this command with the /f parameter, see the db2unins command for details.

If you did not successfully remove the Microsoft Cluster Service Instance, entries are left behind in the registry. These entries can prevent successful reinstallation of DB2, or switching between ESE and WSE. You can edit the registry to manually remove these entries. Using the regedit tool, remove the DB2 entries from the following locations:

  • HKEY_LOCAL_MACHINE\Cluster\
  • HKEY_LOCAL_MACHINE\SOFTWARE\IBM\DB2\
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\
Attention: Using the regedit must be done with care as it can cause your computer to become unusable.