3/2/09

5 Simple Commands to Remove DB2 Cleanly

Before you install new version of DB2, if you need to remove the old version, please perform the following steps:

1. Log in as root.
2. List all DB2 instances:
bash# //instance/db2ilist

3. Drop each instance listed in the previous step with the following command:
bash# //instance/db2idrop instance-name

4. Drop the DB2 administration server:
bash# //instance/dasidrop `//instance/dasilist`

5. Uninstall all of the DB2 packages on your system using the db2deinstall command on your DB2 CD-ROM or from the unpackaged directory:
bash# /mnt/cdrom/db2/db2_deinstall -n

Actual example:

staff1@pw70:/opt/IBM/db2/V9.5/instance>./db2idrop db2inst1
DBI1070I Program db2idrop completed successfully.

staff1@pw70:/opt/IBM/db2/V9.5/instance>./db2idrop db2ins91
DBI1070I Program db2idrop completed successfully.

staff1@pw70:/opt/IBM/db2/V9.5/instance>daslist
dasusr

staff1@pw70:/opt/IBM/db2/V9.5/instance>dasdrop dasusr

SQL4410W The DB2 Administration Server is not active.
DBI1070I Program dasdrop completed successfully.

staff1@pw70:/data/software/db2v953a/server>./db2_deinstall -a

Enter full path name for the install directory -
------------------------------------------------
/opt/IBM/db2/V9.5
DBI1016I Program db2_deinstall is performing uninstallation. Please
wait.
The execution completed successfully.

.pw.