Wednesday, 8 November 2017

Hmmm, why can't root uninstall IBM DB2 ?

I'm cleaning up a VM, and looking to remove DB2 11.1: -

/opt/ibm/db2/V10.5/install/db2_deinstall -a

DBI1149E  To execute this program, you must be the owner of the
      installation copy.

Explanation: 

The current DB2 copy was not installed by the user who is running the
program.

User response: 

Log in as the user who installed the current copy of DB2 and rerun the
command.


Given that I'm doing this as root, I'm wondering "Whaaaaat?"

So I dug further …

/opt/ibm/db2/V10.5/install/db2ls

Install Path                       Level   Fix Pack   Special Install Number   Install Date                  Installer UID 
---------------------------------------------------------------------------------------------------------------------
/opt/ibm/db2/V10.5               10.5.0.5        5                            Sun Apr  5 21:33:46 2015 BST             0 


which shows me that the installing user is UID 0 aka root, as evidenced below: -

id

uid=0(root) gid=0(root) groups=0(root)

Following this IBM document: -


I checked further: -

/opt/ibm/db2/V10.5/bin/db2val -o

DBI1379I  The db2val command is running. This can take several minutes.

DBI1335I  Installation file validation for the DB2 copy installed at
      /opt/ibm/db2/V10.5 was successful.

DBI1343I  The db2val command completed successfully. For details, see
      the log file /tmp/db2val-171108_124437.log.


cat /tmp/db2val-171108_124437.log

Installation file validation for the DB2 copy installed at "/opt/ibm/db2/V10.5" starts.

Task 1: Validating Installation file sets.
Status 1 : Success 

Task 2: Validating embedded runtime path for DB2 executables and libraries.
Status 2 : Success 

Task 3: Validating the accessibility to the installation path.
Status 3 : Success 

Task 4: Validating the accessibility to the /etc/services file.
Status 4 : Success 

DBI1335I  Installation file validation for the DB2 copy installed at
      /opt/ibm/db2/V10.5 was successful.

Installation file validation for the DB2 copy installed at "/opt/ibm/db2/V10.5" ends.

DBI1343I  The db2val command completed successfully. For details, see
      the log file /tmp/db2val-171108_124437.log.


which left me none the wiser.

I checked the permissions: -

ls -al /opt/ibm/db2/

total 12
drwxr-xr-x.  3 wasadmin wasadmins 4096 Apr  5  2015 .
drwxr-xr-x.  5 wasadmin wasadmins 4096 Nov  8 12:34 ..
drwxr-xr-x. 41 wasadmin wasadmins 4096 Apr  5  2015 V10.5


which pointed out where I was going wrong.

At some point, I'd gone back and done a chown on the /opt/ibm file-system :-)

DOOFUS!!

I fixed this: -

chown -R root:root /opt/ibm/db2/

ls -al /opt/ibm/db2

total 12
drwxr-xr-x.  3 root     root      4096 Apr  5  2015 .
drwxr-xr-x.  5 wasadmin wasadmins 4096 Nov  8 12:34 ..
drwxr-xr-x. 41 root     root      4096 Apr  5  2015 V10.5

and then retried the uninstallation: -

/opt/ibm/db2/V10.5/install/db2_deinstall -a

DBI1016I  Program db2_deinstall is performing uninstallation. Please
      wait.


The execution completed successfully.

For more information see the DB2 uninstallation log at
"/tmp/db2_deinstall.log.112308".

:-)

For the record, I'd already dropped the databases, and removed the instance: -

/opt/ibm/db2/V10.5/instance/db2idrop db2inst1

and the DB2 Administration Service (DAS): -

/opt/ibm/db2/V10.5/instance/dasdrop

No comments: