By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,004 Members | 1,222 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,004 IT Pros & Developers. It's quick & easy.

installing DB2 on Linux

P: n/a
I recently installed DB2 v8.1 on Linux. The installation went
smoothly. I can now connect to the "sample" database and work with
it.

However, I noticed the following. How do I go about fixing these?

1) When in db2, if the SQL statements contain a syntax error, the
whole application crashes. This happens, for example, if I type
"select * from emps" where the table emps does not exist.

2) db2cc does not start, gives error messages about "Can't find
library
db2jdbc (libdb2jdbc.so)"

3) db2ca does not start. It too gives error messages about some java
class: "Can't find library db2adtca (libdb2adtca.so) in
java.library.path"

4) How do I stop/start instances?
Nov 12 '05 #1
Share this Question
Share on Google+
8 Replies


P: n/a
tu*****@yahoo.com wrote:
I recently installed DB2 v8.1 on Linux. The installation went
smoothly. I can now connect to the "sample" database and work with
it.

However, I noticed the following. How do I go about fixing these?

1) When in db2, if the SQL statements contain a syntax error, the
whole application crashes. This happens, for example, if I type
"select * from emps" where the table emps does not exist.
That should not happen:

db2 => select * from emps;
SQL0204N "JDBEYER.EMPS" is an undefined name. SQLSTATE=42704
db2 =>

2) db2cc does not start, gives error messages about "Can't find
library
db2jdbc (libdb2jdbc.so)"
I do not use db2cc; got in the habit of not using that in V6.1 days when
it ran so slowly that I could not stand it.

Did you install it?

trillian:jdbeyer[~]$ locate libdb2jdbc.so
/opt/IBM/db2/V8.1/lib/libdb2jdbc.so
/opt/IBM/db2/V8.1/lib/libdb2jdbc.so.1
3) db2ca does not start. It too gives error messages about some java
class: "Can't find library db2adtca (libdb2adtca.so) in
java.library.path"
trillian:jdbeyer[~]$ locate libdb2adtca.so
/opt/IBM/db2/V8.1/lib/libdb2adtca.so
/opt/IBM/db2/V8.1/lib/libdb2adtca.so.1 4) How do I stop/start instances?


db2istrt

In Red Hat Enterprise Linux 3 ES, I have a file in /etc/rc.d/init.d for
that. Named IBMdb2. It is 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 # Where (a small part of the) instance will be.
# 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
~

--
.~. Jean-David Beyer Registered Linux User 85642.
/V\ Registered Machine 241939.
/( )\ Shrewsbury, New Jersey http://counter.li.org
^^-^^ 12:55:00 up 7 days, 22:36, 5 users, load average: 4.16, 4.12, 4.09

Nov 12 '05 #2

P: n/a
<tu*****@yahoo.com> wrote in message
news:32**************************@posting.google.c om...
I recently installed DB2 v8.1 on Linux. The installation went
smoothly. I can now connect to the "sample" database and work with
it.

However, I noticed the following. How do I go about fixing these?

1) When in db2, if the SQL statements contain a syntax error, the
whole application crashes. This happens, for example, if I type
"select * from emps" where the table emps does not exist.

2) db2cc does not start, gives error messages about "Can't find
library
db2jdbc (libdb2jdbc.so)"

3) db2ca does not start. It too gives error messages about some java
class: "Can't find library db2adtca (libdb2adtca.so) in
java.library.path"

4) How do I stop/start instances?


Need more info on which Linux you are using. If using RH9 or equivalent,
check the google groups archive for tips on getting it to work (DB2 is not
officially supported on RH9).
Nov 12 '05 #3

P: n/a
tu*****@yahoo.com wrote in message news:<32**************************@posting.google. com>...
I recently installed DB2 v8.1 on Linux. The installation went
smoothly. I can now connect to the "sample" database and work with
it.

However, I noticed the following. How do I go about fixing these?

1) When in db2, if the SQL statements contain a syntax error, the
whole application crashes. This happens, for example, if I type
"select * from emps" where the table emps does not exist.

2) db2cc does not start, gives error messages about "Can't find
library
db2jdbc (libdb2jdbc.so)"
Do you have java installed on the system? I remember when I first
tried to use db2cc and db2dc on my linux laptop, I didn't have the
correct version of Java installed. After installing the rpms ( I use
RH9 ) for Java 1.3.2 I believe, I still was missing a link. I created
a symbolic link in /opt/IBM/db2/V8.1/ someplace and everything started
fine after that. I forget where right now and I don't have it in
front of me, but I know I found the missing link info in the DB2
information center on the web.

Sorry I can't be more helpful, but I can post more info on Monday if
you still need help.

Otherwise you can start/stop DB2 by executing the
/INSTANCE_OWNER_HOME/sqllib/db2profile in you current shell and then
just type db2start or db2stop.


3) db2ca does not start. It too gives error messages about some java
class: "Can't find library db2adtca (libdb2adtca.so) in
java.library.path"

4) How do I stop/start instances?

Nov 12 '05 #4

P: n/a
I got the db2 command line to work. I am not sure what I did but I was
trying the commands in the shell script.

As far as the the db2cc and db2ca, they still do not work. The locate
command returns nothing. How do I install them?

Thanks!

Nov 12 '05 #5

P: n/a
Mark,

I am using Mandrake 9.2. I realize this is not an officially supported
distro, but this is for personal use and for learning. It installed fine,
actually, and is working apart from db2cc/db2ca tools.
Nov 12 '05 #6

P: n/a
I believe I have Java installed. As you noted, it may be a different
version, though.. I will look into it. If you could post more info on
Monday, I'd appreciate it.

Thanks!
Nov 12 '05 #7

P: n/a
> Mark,

I am using Mandrake 9.2. I realize this is not an officially supported
distro, but this is for personal use and for learning. It installed fine,
actually, and is working apart from db2cc/db2ca tools.

No, it did install fine. Go to the newsgroup archive on Google and find the
instructions like I told you to. The Java stuff will not work unless you do
some workaround steps, because DB2 does not work properly with Linux version
9. The reason it is not "supported" is because it does not work properly
with Linux 9 (yes, IBM tested it). But you can get it to install correctly
with the workarounds.
Nov 12 '05 #8

P: n/a
"Mark A" <no****@nowhere.com> wrote in message
news:IY*****************@news.uswest.net...
Mark,

I am using Mandrake 9.2. I realize this is not an officially supported
distro, but this is for personal use and for learning. It installed fine, actually, and is working apart from db2cc/db2ca tools.
No, it did install fine. Go to the newsgroup archive on Google and find

the instructions like I told you to. The Java stuff will not work unless you do some workaround steps, because DB2 does not work properly with Linux version 9. The reason it is not "supported" is because it does not work properly
with Linux 9 (yes, IBM tested it). But you can get it to install correctly
with the workarounds.

Correction:

No, it did NOT install fine.
Nov 12 '05 #9

This discussion thread is closed

Replies have been disabled for this discussion.