Tuesday, August 7, 2012

DB2 UDB - Interesting quirk with auto-start on Linux

I've posted about DB2 auto-starting issues before: -

Automagically starting DB2 UDB on Linux - revisited

but I found an interesting and quirky new challenge with DB2 UDB 9.7 today.

I'm using Red Hat Enterprise Linux 6.3 x86-64 under VMware Fusion 4 on an Apple Mac.

$ /opt/ibm/db2/V9.7/bin/db2level 

DB21085I  Instance "db2inst1" uses "64" bits and DB2 code release "SQL09075" 
with level identifier "08060107".
Informational tokens are "DB2 v9.7.0.5", "s111017", "IP23292", and Fix Pack 
"5".
Product is installed at "/opt/ibm/db2/V9.7".


The major symptom was that DB2 wasn't auto-starting after a reboot, despite my following all my previous advice.

One difference between now and then is that, with RHEL 6.3, the DB2 Fault Monitor is no longer started by /etc/inittab but is instead started by /etc/init/db2fmcd.conf.

This is described in various Technotes, including: -


...
As of RHEL 6, the /etc/inittab file has been deprecated. Specifying this option removes the db2fmcd.conf file.
...

So I checked my system, and could see /etc/init/db2fmcd.conf which contained: -

# DB2 fault monitor 
# Starts fmcd
# Note: any customizations to this file will be lost the next time this is updated

description 'Fault Monitor is the DB2 database facility that monitors DB2 database manager instances, and restarting any instance that exits permaturely.'
version 'DB2 v9.7.0.5'

start on stopped rc RUNLEVEL=[2345]
stop on starting rc RUNLEVEL=[016]

console output
respawn
respawn limit 10 120

exec /opt/ibm/db2/V9.7/bin/db2fmcmd


So being me, I checked to see whether the listed program - /opt/ibm/db2/V9.7/bin/db2fmcmd - actually exists.

$ ls -al /opt/ibm/db2/V9.7/bin/db2fmcmd

which returned: -

ls: cannot access /opt/ibm/db2/V9.7/bin/db2fmcmd: No such file or directory

However, we do have: -

$ ls -al /opt/ibm/db2/V9.7/bin/db2fmcd 

-r-xr-xr-x 1 bin bin 145964 Aug  1 18:10 /opt/ibm/db2/V9.7/bin/db2fmcd

So I updated /etc/init/db2fmcd.conf as follows: -

# DB2 fault monitor 
# Starts fmcd
# Note: any customizations to this file will be lost the next time this is updated

description 'Fault Monitor is the DB2 database facility that monitors DB2 database manager instances, and restarting any instance that exits permaturely.'
version 'DB2 v9.7.0.5'

start on stopped rc RUNLEVEL=[2345]
stop on starting rc RUNLEVEL=[016]

console output
respawn
respawn limit 10 120

# exec /opt/ibm/db2/V9.7/bin/db2fmcmd
exec /opt/ibm/db2/V9.7/bin/db2fmcd


and rebooted.

Lo and behold, DB2 then automagically started.

Interesting ?

No comments:

Post a Comment