View Single Post

   
  #3 (permalink)  
Old 02-26-2008, 05:58 PM
Philip Nelson
 
Posts: n/a
Default Re: Autostart DB2 under Red Hat Enterprise Linux

Jean-David Beyer wrote:

> 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=TRUE
>>
>> 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|restart|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:jdbeyer[/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.
>


Try DB2AUTOSTART=YES rather than DB2AUTOSTART=TRUE

Phil
Reply With Quote