Tuesday 25 January 2011

IBM Software on Ubuntu Linux - Fun with DB2 UDB

As part of my ongoing mission to run all of my personal test/demonstration environments natively on Ubuntu Linux, I was hitting a problem with DB2 UDB as installed under-the-covers by WebSphere Portal Express.

I'd previously blogged on the dash vs. bash shell problem, and was able to get around that.

However, I then hit an issue whereby the installation was failing with: -

ERROR:DBI1131E The user ID  wpx70db2 is invalid.

being displayed in the installation log.

This turned out to be due to the earlier installation failing, but leaving bits of itself behind.

*CAVEAT* This is *NOT* the proper way to uninstall a software product *CAVEAT*

As a complete cheat, I'd been *cough* uninstalling merely by: -

  • deleting the contents of /opt/IBM*            rm -Rf /opt/IBM
  • deleting the contents of /opt/.ibm*            rm -Rf /opt/.ibm
  • removing the DB2 users                                     userdel --remove wpx70db2  and userdel --remove wpdb2fen

Sadly, alas, this wasn't enough - I had forgotten to remove the DB2 profiles registry - /var/db2/global.reg.

Again, being a complete hacker, I simply removed the /var/db2 directory - rm -Rf /var/db2.

*CAVEAT* This is *NOT* the proper way to uninstall a software product *CAVEAT*

Having done all of the above hackiness, I then tried the installation again.

This time, it installed but failed to start - this turned out to be because the DB2 instance wouldn't start.

When I tried to do this manually: -

su - wpx70db2
db2start

I got: -

SQL1084C Shared memory segments cannot be allocated. SQLSTATE=57019

Thankfully, somebody else had seen, and blogged the problem AND solution.

This required me to increase the memory available to DB2 by editing: -

/etc/sysctl.conf

and adding: -

kernel.sem=250 256000 32 1024
#Example shmmax for a 32-bit system
kernel.shmmax=1073741824
#Example shmall for 90 percent of 16 GB memory
kernel.shmall=3774873
kernel.msgmax=65535
kernel.msgmnb=65535

to increase the deafult segment size from 256 MB to 1 GB.

Once I did this, and ran sysctl -p, all was well.

I can now start DB2 at will, and WebSphere Portal Express 7 is running like a dream.

No comments:

Visual Studio Code - Wow 🙀

Why did I not know that I can merely hit [cmd] [p]  to bring up a search box allowing me to search my project e.g. a repo cloned from GitHub...