Bill Medland wrote:
Can anyone tell me what I am doing wrong?
I installed DB2 8.1 + FP5 on Red Hat Enterprise Linux 3 (Update 1),
using the command line method (i.e. db2_install and vi and ....)
The one bit that didn't seem to be documented was how to set the
system up so that my instance would start automatically at boot time.
The /etc/inittab has the db2fmcd included.
The instance has DB2AUTOSTART=TR UE
Any idea what is missing?
Bill
I do have idea what is missing: you must start the instance(s). Here is
how I do mine:
In directory /etc/rc.d/init.d I have a file like this:
#!/bin/sh
# chkconfig: 35 98 02
# description: Start and Stop IBM's db2 dbms.
BASE=/opt/IBM/db2
VERSION=V8.1
INSTANCE=/dataA/db2inst1
# Set the path.
PATH=/sbin:/bin:/usr/bin:/usr/sbin
.. /etc/rc.d/init.d/functions
# Check we have the start and stop programs.
test -x $INSTANCE/sqllib/adm/db2start || exit 0
test -x $INSTANCE/sqllib/adm/db2stop || exit 0
test -x $BASE/$VERSION/bin/db2 || exit 0
case "$1" in
start)
# Check if IBMdb2 not already running
if [ ! -f /var/lock/subsys/IBMdb2 ]; then
echo -n 'Starting IBMdb2 daemons: '
su - db2inst1 -c $INSTANCE/sqllib/adm/db2start
echo
touch /var/lock/subsys/IBMdb2
fi
;;
stop)
# We first try twice to kill all existing applications.
# There really should be none most of the time.
echo 'Stopping IBMdb2 daemons: '
su - db2inst1 -c "$BASE/$VERSION/bin/db2 FORCE APPLICATION ALL"
sleep 2
su - db2inst1 -c "$BASE/$VERSION/bin/db2 FORCE APPLICATION ALL"
sleep 2
su - db2inst1 -c $INSTANCE/sqllib/adm/db2stop
echo
rm -f /var/lock/subsys/IBMdb2
;;
reload|restart)
$0 stop
sleep 3
$0 start
;;
*)
echo "Usage: /etc/rc.d/init.d/IBMdb2 {start|stop|res tart|reload}"
exit 1
esac
#-----------------------------------------------------------------------
# Exit successfully.
#-----------------------------------------------------------------------
exit 0
You will want to modify the "INSTANCE=/dataA/db2inst1" line to find your
instance. You should also run /sbin/chkconfig on this (read the manual
page). This file should list like this:
trillian:jdbeye r[/etc/rc.d/init.d]$ ls -l IBMdb2
-rwxr-xr-x 1 root root 1360 Apr 29 15:17 IBMdb2
In fact, you might want to remove execute permission from world--other.
--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ Registered Machine 241939.
/( )\ Shrewsbury, New Jersey
http://counter.li.org
^^-^^ 14:20:00 up 17 days, 15:03, 3 users, load average: 4.11, 4.05, 3.18