In this article, I run through the steps that I took to allow a DB2 UDB 9.7 instance to auto-start on Red Hat Enterprise Linux 6.3.
# 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/db2fmcd
-r-xr-xr-x 1 bin bin 145964 Nov 19 12:26 /opt/ibm/db2/V9.7/bin/db2fmcd
So I've blogged about DB2 autostart on a number of occasions, including: -
but I've just gone back through the steps again, having re-read my earlier posts, and also this IBM Technote: -
and this is precisely what I did: -
As root
$ cd /opt/ibm/db2/V9.7/bin/
$ ./db2fmcu -u -p /opt/ibm/db2/V9.7/bin/db2fmcd
$ ./db2fm -i db2inst1 -U
$ ./db2fm -i db2inst1 -u
$ ./db2fm -i db2inst1 -f on
$ ./db2fmcu -u -p /opt/ibm/db2/V9.7/bin/db2fmcd
$ ./db2fm -i db2inst1 -U
$ ./db2fm -i db2inst1 -u
$ ./db2fm -i db2inst1 -f on
As db2inst1
$ db2fm -s -S
which returns: -
Gcf module 'fault monitor' is NOT operable
Gcf module '/home/instance_name/sqllib/lib/libdb2gcf.so' state is AVAILABLE
Gcf module '/home/instance_name/sqllib/lib/libdb2gcf.so' state is AVAILABLE
As root
$ reboot
As db2inst1
$ db2fm -s -S
which returns: -
Gcf module 'fault monitor' state is AVAILABLE
Gcf module '/opt/ibm/db2/V9.7/lib64/libdb2gcf.so' state is AVAILABLE
Gcf module '/opt/ibm/db2/V9.7/lib64/libdb2gcf.so' state is AVAILABLE
It took about 30 seconds for DB2 to start up, following the reboot, and I was a little impatient :-)
However, the database DID come up :-)
It's worth noting that, until I ran the command: -
$ ./db2fmcu -u -p /opt/ibm/db2/V9.7/bin/db2fmcd
I did not have the required DB2 Fault Monitor Command file - /etc/init/db2fmcd.conf - this file simply did not exist, and there was no mention of DB2FM in /etc/inittab, which has been deprecated in Red Hat 6.
However, once I ran this command ( as root, as above ), the file was created, with the following contents: -
$ cat /etc/init/db2fmcd.conf
# 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/db2fmcd
and, unsurprisingly, the target db2fmcd binary also exists: -
$ ls -al /opt/ibm/db2/V9.7/bin/db2fmcd
-r-xr-xr-x 1 bin bin 145964 Nov 19 12:26 /opt/ibm/db2/V9.7/bin/db2fmcd
For the record, I'm running DB2 9.7.0.5: -
$ /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".
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".
on Red Hat Enterprise Linux 6.3: -
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)