DB2 10.5 for Linux, UNIX, and Windows

db2_deinstall - Uninstall DB2 database products, features, or languages command

Uninstalls DB2® database products, features, or languages, depending on the command parameters and the location where the db2_deinstall command is run. The command is only available on Linux and UNIX operating systems.

The db2_deinstall command is located at DB2DIR/install, where DB2DIR is the location where the current version of the DB2 database product is installed. The db2_deinstall command is also available on DB2 database product media. The db2_deinstall command can be used to uninstall only the DB2 database products related to the installation path.

Authorization

Root installations require root user authority.

Required Connection

None

Command syntax

Read syntax diagramSkip visual syntax diagram
>>-db2_deinstall-- -F--feature-name----------------------------->

>--+- -a--+-----------+--+------------+-+--+-------------+------>
   |      '- -s--GPFS-'  '- -s--TSAMP-' |  '- -f--sqllib-'   
   '- -r--response-file-----------------'                    

>--+------------------+--+---------------+---------------------->
   '- -b--installpath-'  '- -l--log-file-'   

>--+-----------------+--+-----+--------------------------------><
   '- -t--trace-file-'  +- -h-+   
                        '- -?-'   

Command parameters

-F feature-name

Specifies the removal of one feature. To indicate uninstallation of multiple features, specify this parameter multiple times. For example, -F feature1 -F feature2.

Cannot be used in combination with -a, except in one case. When the feature being removed is IBM® Tivoli® System Automation for Multiplatforms (SA MP) and you have root user authority, you must use -F TSAMP and -a in combination, which removes both SA MP and DB2 database products together.

Can be used in combination with -r, except in one case. When the feature being removed is IBM Tivoli System Automation for Multiplatforms (SA MP), you cannot use -F TSAMP and -r in combination.

The DB2 database uninstaller will automatically update the related DB2 instances after it removed some DB2 features. If instance update failed as reported in the log file, you need to manually update the related DB2 instances with the db2iupdt (root instances) or db2nrupdt (non-root instance) command.

-f sqllib

This parameter is only valid for non-root install. When it is used with -a, the instance top directory and anything underneath will be removed.

-a

This parameter is mandatory when running the db2_deinstall command on a IBM DB2 pureScale® Feature copy. Removes all installed DB2 database products in the current location. Cannot be used in combination with -F, except in one case. When the feature being removed is IBM Tivoli System Automation for Multiplatforms (SA MP) and you have root user authority, you must use -F TSAMP and -a in combination, which removes both SA MP and DB2 database products together.

Cannot be combined with the -r parameter.

In a non-root install, -a used with -f sqllib will also remove the non-root instance, which includes removal of the $HOME/sqllib directory.

-s GPFS
If IBM General Parallel File System (GPFS™) was installed as part of a DB2 pureScale Feature installation, GPFS is also uninstalled automatically. Specifying this parameter skips the removal of GPFS. You may want to use this parameter to keep the GPFS cluster and its file systems, but remove the DB2 copy. This parameter can only be combined with the -a parameter.
-s TSAMP
If IBM Tivoli System Automation for Multiplatforms (SA MP) was installed as part of a DB2 pureScale Feature installation, SA MP is also uninstalled automatically. Specifying this parameter skips the removal of SA MP. You may want to use this parameter to keep the RSCT peer domain, but remove the DB2 copy. This parameter can only be combined with -a or -F parameters.
-r response-file

Performs an uninstallation of products, features, or languages based on what is specified in the response file. For example, db2_deinstall -r db2un.rsp. The DB2 product image includes ready-to-use sample response files with default entries. The sample response file to uninstall products, features, or languages is db2un.rsp. The db2un.rsp file can be found in DB2DIR/install path.

Cannot be combined with the -a parameter, or -s parameter.

Can be combined with the -F parameter, except in one case. When the feature being removed is IBM Tivoli System Automation for Multiplatforms (SA MP), you cannot use -F TSAMP and -r in combination.

If both the -r and -F parameters are specified, the DB2 features specified in the -F parameter override the REMOVE_COMP keywords in the response file.

The DB2 database uninstaller will automatically update the related DB2 instances after it removed some DB2 features. If instance update failed as reported in the log file, you need to manually update the related DB2 instances with the db2iupdt (root instances) or db2nrupdt (non-root instance) command.

-b

This parameter is valid if the command is run from the DB2 database product media. It specifies the absolute path where the DB2 database product was installed and will be uninstalled. The command will prompt for the path if the parameter is not specified.

-l log-file

Specifies the log file. For root installations, the default log file is /tmp/db2_deinstall.log$$, where $$ represents the process ID.

For non-root installations, the default log file is /tmp/db2_deinstall_userID.log, where userID represents the user ID that owns the non-root installation. When the feature being removed is IBM Tivoli System Automation for Multiplatforms (SA MP), the install log file for SA MP will be located in the same directory as DB2 database log files.

-t trace-file

Turns on the debug mode. The debug information is written to the file name specified as trace-file.

-h | -?

Displays help information.

Example

To uninstall all the DB2 database products that are installed in a location (DB2DIR), issue the db2_deinstall command located in the DB2DIR/install directory:
   DB2DIR/install/db2_deinstall -a -l /tmp/db2_deinstall.log 
      -t /tmp/db2_deinstall.trc

Usage notes

  • If you run db2_deinstall -a, only the components and features installed by the DB2 database installer are removed.
  • Before running the db2_deinstall command, you must manually remove the IBM General Parallel File System (GPFS) cluster and file system. Otherwise, you must run the db2_deinstall command with the -s parameter to skip the removal of GPFS binary files. You can also run the db2_deinstall command with the -s parameter to skip the removal of SA MP.
  • SA MP cannot be uninstalled individually with db2_deinstall command to safe guard users from consequences of removing SA MP with an existing domain.