Friday 19 June 2009

Automagically starting DB2 UDB on Linux - revisited

Following on from my earlier posting, I've been experimenting further with DB2 automatic startup.

It appears to be a complex case, and I ended up booting and rebooting a number of times, before I cracked it.

In the end, it looks like the process that starts DB2 is known as the Fault Monitor ( db2fm ), which starts up when the server is booted, via this line: -

fmc:2345:respawn:/opt/ibm/db2/V9.1/bin/db2fmcd #DB2 Fault Monitor Coordinator

in /etc/inittab.

However, this relies upon the Fault Monitor to be correctly configured.

I checked that it was running via the following command: -

ps -ef | grep db2fm

which showed: -

root 5627 1 0 19:23 ? 00:00:00 /opt/ibm/db2/V9.1/bin/db2fmcd
dasusr1 6829 1 0 19:24 ? 00:00:00 /opt/ibm/db2/V9.1/das/bin/db2fmd -i dasusr1 -m /opt/ibm/db2/V9.1/das/lib/libdb2dasgcf.so.1
db2inst1 6838 1 0 19:24 ? 00:00:00 /opt/ibm/db2/V9.1/bin/db2fmd -i db2inst1 -m /opt/ibm/db2/V9.1/lib32/libdb2gcf.so.1

so that wasn't the problem.

Using: -

DB2 does not automatically restart after restart on Unix system


How to use fault monitors to automatically restart DB2 UDB instances


for inspiration, I ran the command: -

db2fm -s -S

which showed: -

Gcf module 'fault monitor' is NOT operable
Gcf module '/home/instance_name/sqllib/lib/libdb2gcf.so' state is AVAILABLE

so I ran: -

Start up the fault monitor daemon

./db2fm -i instance_name -U

Start up the fault monitor service

./db2fm -i instance_name-u

Turn on the fault monitor for the instance

./db2fm -i instance_name -f on

and, after a reboot, ran: -

db2fm -s -S

which showed: -

Gcf module 'fault monitor' state is AVAILABLE
Gcf module '/home/test/sqllib/lib/libdb2gcf.so' state is AVAILABLE

However, following a reboot, DB2 still adamantly refused to start.

So, before reaching for a hammer, I tried two more things - I ran the following command

/opt/IBM/db2/V9/bin/db2greg -clean

as root and then ran: -

db2set DB2AUTOSTART=YES
db2iauto -on db2inst1

Following a reboot, DB2 now seems to start automatically - it was a long road, but it was worth it.

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...