How to use fault monitors to automatically restart DB2 UDB instances

Technote (FAQ)


Question

How can I automatically restart my DB2 UDB instances? This document lists step by step instructions for setting up the Fault Monitor Facility to automatically restart DB2 UDB instances.

Cause

The db2iauto command enables and disables the auto-start of an instance after each system restart. With Fault Monitor facility, if the DB2® Universal Database™ (DB2 UDB) instance exits prematurely, the fault monitor will restart it.

Answer

  1. Log in as Root

  2. Determine whether there are any db2fmcd entries in the /etc/inittab file:
    cat /etc/inittab | grep db2fmcd
    If there are, remove them or comment them out before proceeding. To remove the entry, use the command: db2fmcu -d

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

    As of Solaris 10, the /etc/inittab file has been deprecated. Specifying this option disables the SMF service named 'db2fm'.

  3. Make sure there are no db2fmcd (Fault Monitor Coordinator Daemon (FMCD)), db2fmd (Fault Monitor Daemon) or db2fm (Fault Monitor) processes running:
    ps -ef | grep db2fm
    If there are, remove (kill) the process before proceeding.

  4. Go to the DB2DIR/bin directory, where DB2DIR represents /usr/opt/db2_08_01 on AIX®, and /opt/IBM/db2/V8.1 on Solaris, HP-UX and Linux®. If you are using Solaris, the path may be slightly different, since you can override the default installation path at the time of installation.

  5. Enable the Fault Monitor Coordinator:
    ./db2fmcu -u -p /opt/IBM/db2/V8.1/bin/db2fmcd
    This step adds an entry to the /etc/inittab so that the FMCD process will be started each time you reboot. The entry will be similar to the following:
    fmc:2345:respawn:/opt/IBM/db2/V8.1/bin/db2fmcd #DB2 Fault Monitor Coordinator

    As of Red Hat Enterprise Linux (RHEL) 6, the /etc/inittab file has been deprecated. Specifying this option creates or replaces the db2fmcd.conf file under the /etc/init directory.

    As of Solaris 10, the /etc/inittab file has been deprecated. Specifying this option creates and enables the SMF service named 'db2fm'.

  6. Start up the fault monitor daemon:
    ./db2fm -i instance_name -U

  7. Start up the fault monitor service:
    ./db2fm -i instance_name -u

  8. Turn on the fault monitor for the instance:
    ./db2fm -i instance_name -f on

  9. Verify the fault monitor state. Log in as the instance owner, then perform the command:
    db2fm -s -S
    You should see output similar to the following:
    Gcf module 'fault monitor' is NOT operable
    Gcf module '/home/instance_name/sqllib/lib/libdb2gcf.so' state is AVAILABLE

  10. Reboot the server. The fault monitor service should be available once the server has been rebooted.

  11. Verify the fault monitor state. Login as the instance owner, then perform the command:
    db2fm -s -S
    You should see output similar to the following:
    Gcf module 'fault monitor' state is AVAILABLE
    Gcf module '/home/test/sqllib/lib/libdb2gcf.so' state is AVAILABLE

  12. Log in as Root.

  13. Go to the DB2DIR/bin directory (per step 4).

  14. Verify the FMC Daemon state using the command:
    db2fmcu
    FMC: up: PID = 3415

  15. At this point, if the instance is shut down in any way other than via the db2stop command, the fault monitor will start it up again. If you want to test the fault monitor's functionality, bring down the DB2 UDB instance. For example, issue the command:
    db2_kill

  16. The instance will be automatically restarted.

Note: This document was tested and created using DB2 versions 8.2 and 9.1.




For further discussion on this topic, visit this developerWorks forum thread:
https://www.ibm.com/developerworks/community/forums/html/topic?id=29fc0820-f6b3-4a7d-aaf5-5925835a0c0f

Related information

Fault monitor facility for UNIX-based systems
RHEL6
SOLARIS

Rate this page:

(0 users)Average rating

Add comments

Document information


More support for:

DB2 for Linux, UNIX and Windows
High Availability - Fault Monitor

Software version:

8.2, 9.1

Operating system(s):

AIX, HP-UX, Linux, Solaris

Reference #:

1209001

Modified date:

2014-05-12

Translate my page

Machine Translation

Content navigation