LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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


Reply
  Search this Thread
Old 10-24-2009, 09:12 AM   #1
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310

Rep: Reputation: 36
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?
 
Old 10-24-2009, 09:13 AM   #2
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310

Original Poster
Rep: Reputation: 36
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
 
Old 10-25-2009, 03:30 PM   #3
dr_te_z
LQ Newbie
 
Registered: Mar 2006
Location: Zoetermeer, Holland
Distribution: slackware, debian
Posts: 11

Rep: Reputation: 0
http://bbs.archlinux.org/viewtopic.php?id=78825
 
Old 11-01-2009, 05:31 PM   #4
fusion1275
Member
 
Registered: Jul 2007
Location: Knaphill, Surrey
Distribution: Linux Mint
Posts: 310

Original Poster
Rep: Reputation: 36
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
 
Old 11-09-2009, 05:54 AM   #5
dr_te_z
LQ Newbie
 
Registered: Mar 2006
Location: Zoetermeer, Holland
Distribution: slackware, debian
Posts: 11

Rep: Reputation: 0
This is "distro dependant". See how deamons are started & stopped in your distro.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Connection to DB2 Database through Linux script. naren_3276 Linux - General 1 10-23-2008 07:59 AM
Connecting to IBM AS400 db2 database from perl keysorsoze Programming 2 10-12-2008 11:01 AM
db2 connection with tivoli identity manager bajaj111 Linux - Software 0 12-20-2006 03:08 AM
LXer: DB2 Express: Another nail in the free database coffin? LXer Syndicated Linux News 0 02-10-2006 09:46 PM
LXer: DB2- the secret database LXer Syndicated Linux News 0 01-18-2006 09:31 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 07:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration