db2unins - Uninstall Db2 database products, features, or languages command

Uninstalls one or more Db2 database products, features, or languages.

db2unins can be found both in the installation media and in a Db2 install copy on the system. If run from the installation media, only the -f, -l, -t and -? parameters can be used. If run from a Db2 install copy, all the options except -f can be used.

Authorization

SYSADM

Required connection

None

Command syntax

Read syntax diagramSkip visual syntax diagramdb2unins-d-f-pproducts-uresponse-file-llog-file-ttrace-file-y-?

Command parameters

Note:

On Windows operating systems, the db2unins command can use the / or - switch symbols interchangeably.

Running the db2unins command without any of the -?, -d, -p or -u parameters will result in the removal of all Db2 database products under the current installation directory.

-d
Displays the products that are installed in the current Db2 copy on the system. This option is only available when executed from an installed copy of a Db2 database product.
-f
Performs a brute force uninstallation of all Db2 database products on the system. The db2unins -f command can only be issued from the installation media. Your system will reboot when you successfully issue db2unins -f. It can only be issued if there are no other Db2 products before version 9 installed on the system.
-p products
Specifies the products to be uninstalled. This parameter is only available when run from an installed Db2 copy. To uninstall multiple products, separate a list of products by a semicolon and enclosed in double quotation marks. When both parameters -p and -u are specified, the products specified in -p override the products specified in the response file. For example, db2unins -p "SERVER;QP" -u db2un.rsp uninstalls both Db2 SERVER and QP regardless of the REMOVE_PROD keyword value in db2un.rsp.
-u response-file
Performs an uninstallation of products, features, or languages based on what is specified in the response file. For example, db2unins -u db2un.rsp. This parameter is only available when run from an installed Db2 copy. If both parameters -p and -u are specified, the Db2 products specified in the -p parameter override the REMOVE_PROD keyword in the response file.
If you have a clustered environment, before uninstalling your Db2 product using a response file, you must first run the db2mscs command, with the -u option, from the same server that originally ran the db2mscs command to create the failover infrastructure. For details, see the db2mscs command.
-l log-file
Specifies the location of the log file. The default log file location is My Documents\DB2LOG\db2un_<timestamp>.log.
-t trace-file
Turns on the trace functionality. The trace file will be used for debugging problems with the db2unins command.
-y
Ensures that no confirmation is done during the uninstallation process.
-?
Displays help for the db2unins command.

Usage notes

  • On Windows operating systems, a file named db2unins can be found in the root directory of the installation image, as well as, installed under the installation path installPath\BIN. However, although they have the same filename, these files are not the same and behave differently. Do not perform a copy and paste operation of the file from the installation image to the installation path directory. If you do, problems will occur.
  • On Windows operating systems, when specifying the full path, the path name must be contained within double quotation marks.
  • If you want to use db2unins -f to manually remove all the Db2 database products on the system, you should use the utility from the version which is equal to the highest Db2 product version on the system. For example, if you have two copies installed, DB2COPY1 which is Db2 V9.1 and DB2COPY2 which is Db2 V9.5, run db2unins -f to remove both Db2 versions from the Db2 V9.5 product image. If you run db2unins -f from the Db2 V9.1 product image, it will not clean the machine completely.
  • If there are instances that are clustered with Microsoft Cluster Service (MSCS), you can uncluster the instance by issuing the db2mscs or db2iclus command before uninstallation.