Uninstalls one or more DB2® database
products, features, or languages. db2unins can
be found both in the installation media and in a DB2 installation 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 installation
copy, all the options except -f can be used.
Command syntax
>>-db2unins--+------------------------------------------+------->
+- -d--------------------------------------+
+- -f--------------------------------------+
'-+---------------+-+--------------------+-'
'- -p--products-' '- -u--response-file-'
>--+---------------+--+-----------------+--+-----+--+-----+----><
'- -l--log-file-' '- -t--trace-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
results 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 reboots when you successfully
issue db2unins -f. It can be issued only if there
are no other DB2 products prior
to 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 "ESE;QP" -u db2un.rsp uninstalls both DB2 ESE 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,
first run the db2mscs -u command 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 is 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 occur.
- On Windows operating systems, when
specifying the full path, the path name must be contained within double
quotes.
- If you want to use db2unins -f to manually
remove all the DB2 database
products on the system, 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 does 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
prior to uninstallation.
- On Windows operating systems, use
the force option -f when you don't want the uninstallation
process to keep a count of the related sub-products, and manually
remove DB2 along with all its
sub-products.