LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   DB2 - No start database manager (https://www.linuxquestions.org/questions/linux-software-2/db2-no-start-database-manager-764158/)

fusion1275 10-24-2009 09:12 AM

DB2 - No start database manager
 
Hi all,

I have installed db2 following many guides which all inform me of the startup script that should be added to start up the instance.

After I rebooted to check all is ok, I ran a few tests:

Quote:

fusion@Zeus-home:~$ db2 list applications
SQL1032N No start database manager command was issued. SQLSTATE=57019
fusion@Zeus-home:~$
fusion@Zeus-home:~$
fusion@Zeus-home:~$ ps -ef |grep db2
fusion 5009 1 0 14:50 pts/1 00:00:00 /home/db2inst1/sqllib/bin/db2bp 4973A1000 5 A
fusion 5778 4973 0 15:11 pts/1 00:00:00 grep db2
fusion@Zeus-home:~$
fusion@Zeus-home:~$
fusion@Zeus-home:~$
fusion@Zeus-home:~$ db2start
SQL1063N DB2START processing was successful.
fusion@Zeus-home:~$
fusion@Zeus-home:~$
fusion@Zeus-home:~$ ps -ef |grep db2
fusion 5009 1 0 14:50 pts/1 00:00:00 /home/db2inst1/sqllib/bin/db2bp 4973A1000 5 A
root 5783 1 2 15:11 pts/1 00:00:00 db2wdog
db2inst1 5785 5783 3 15:11 pts/1 00:00:00 db2sysc
root 5786 5785 0 15:11 pts/1 00:00:00 db2ckpwd
root 5787 5785 0 15:11 pts/1 00:00:00 db2ckpwd
root 5788 5785 0 15:11 pts/1 00:00:00 db2ckpwd
db2inst1 5798 5783 5 15:11 pts/1 00:00:00 db2acd ,0,0,0,1,0,0,2,1,0,8a65b0,14,1e014,2,0,1,11fc0,0x210000000,0x210000000,1600000,f8012,2,11000c
fusion 5803 4973 0 15:11 pts/1 00:00:00 grep db2
fusion@Zeus-home:~$

How can I get the db2start to be run upon every bootup?

fusion1275 10-24-2009 09:13 AM

Forgot to add db2 details:

Quote:

fusion@Zeus-home:~$ db2level
DB21085I Instance "db2inst1" uses "64" bits and DB2 code release "SQL09070"
with level identifier "08010107".
Informational tokens are "DB2 v9.7.0.0", "s090521", "LINUXAMD6497", and Fix
Pack "0".
Product is installed at "/opt/ibm/db2/V9.7".

Rgds

dr_te_z 10-25-2009 03:30 PM

http://bbs.archlinux.org/viewtopic.php?id=78825

fusion1275 11-01-2009 05:31 PM

Thanks for that link.

I have copied the script and amended it using the correct db2 path etc etc.

I've tested the script which I have called db2init with starting it and stopping it manually from the cmd line. All works fine and logs perfectly.

I adding it to /etc/init.d and once it was in the directory I opened the BootUp Manager and ticked the box to have it start on a reboot.

When I rebooted it didnt start and now I cannot see it in the BootUp Managers list.

Here is the script I am using:

Quote:

#!/bin/bash
#
#
# Run-level Startup script for the DB2 Databsse

export DB_USER=db2inst1
export DB2DIR="/opt/ibm/db2/V9.7"

if [ -f /home/db2inst1/sqllib/db2profile ]; then
. /home/db2inst1/sqllib/db2profile
fi

case "$1" in
start)
echo "" >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
echo "Starting DB2 Database: " >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
date +"! %T %a %D : Starting DB2 Database" >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
echo "Starting DB2 Database: " >> /var/log/db2.log
su $DB_USER -c "$DB2DIR/bin/db2 db2start" >> /var/log/db2.log
su $DB_USER -c "$DB2DIR/bin/db2 activate db sample" >> /var/log/db2.log
echo "Done." >> /var/log/db2.log
echo "" >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
date +"! %T %a %D : Start completed." >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
touch /var/lock/db2d
echo "OK"
;;
stop)
echo "Shutting Down DB2 Database:" >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
date +"! %T %a %D : Shutting Down DB2 Databases" >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
echo "Shutting Down DB2 Database: " >> /var/log/db2.log
su $DB_USER -c "$DB2DIR/bin/db2 deactivate db sample" >> /var/log/db2.log
su $DB_USER -c "$DB2DIR/bin/db2 db2stop force" >> /var/log/db2.log
echo "Done." >> /var/log/db2.log
echo "" >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
date +"! %T %a %D : Shutdown completed." >> /var/log/db2.log
echo "----------------------------------------------------" >> /var/log/db2.log
rm -f /var/lock/db2d
echo "OK"
;;
reload|restart)
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> /var/log/db2.log
echo "DB2 Restart Initiated... " >> /var/log/db2.log
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" >> /var/log/db2.log
$0 stop
$0 start
;;
*)
echo "Usage: `basename $0` start|stop|restart|reload"
exit 1
esac

exit 0
In the logs I can see a shutdown being activated on reboots etc but nothing is appended when the system is being started.

Here is a quick list of the scripts/links:

Quote:

root@Zeus-home:/etc# find . -name "*db2init*"
./rc0.d/K20db2init
./rc1.d/K20db2init
./init.d/db2init
./rc6.d/K20db2init
I have even tried to manually add the script using the following:

Quote:

root@Zeus-home:/etc/init.d# update-rc.d db2init start 51 S .
update-rc.d: warning: /etc/init.d/db2init missing LSB information
update-rc.d: see <http://wiki.debian.org/LSBInitScripts>
System start/stop links for /etc/init.d/db2init already exist.
Cheers for any help

dr_te_z 11-09-2009 05:54 AM

This is "distro dependant". See how deamons are started & stopped in your distro.


All times are GMT -5. The time now is 01:45 AM.