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