Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to
LinuxQuestions.org , a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free.
Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please
contact us . If you need to reset your password,
click here .
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a
virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month.
Click here for more info.
10-24-2009, 09:12 AM
#1
Member
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310
Rep:
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?
10-24-2009, 09:13 AM
#2
Member
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310
Original Poster
Rep:
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
10-25-2009, 03:30 PM
#3
LQ Newbie
Registered: Mar 2006
Location: Zoetermeer, Holland
Distribution: slackware, debian
Posts: 11
Rep:
11-01-2009, 05:31 PM
#4
Member
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310
Original Poster
Rep:
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
11-09-2009, 05:54 AM
#5
LQ Newbie
Registered: Mar 2006
Location: Zoetermeer, Holland
Distribution: slackware, debian
Posts: 11
Rep:
This is "distro dependant". See how deamons are started & stopped in your distro.
All times are GMT -5. The time now is 07:19 PM .
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know .
Latest Threads
LQ News