The DB2 Library could not be loaded

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

ecclesr
Premium Member
Premium Member
Posts: 260
Joined: Sat Apr 05, 2003 7:12 pm
Location: Australia

The DB2 Library could not be loaded

Post by ecclesr »

I have installed 11.3.1.1 on Redhat with two server topology Server1 (Repository, services), Server2 (Engine). Default install repository db2 v10.5

The installation has been successfully, installation test jobs have run successfully.

I now wish to create a test job with db2 as a source

I have configured dsenv

DB2DIR=/opt/IBM/DB2
export DB2DIR
DB2INSTANCE=db2inst1
export DB2INSTANCE
INSTHOME=/home/db2inst1
export INSTHOME
PATH=$PATH:$INSTHOME/sqllib/bin:$INSTHOME/sqllib/adm:$INSTHOME/sqllib/misc
export PATH
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$INSTHOME/sqllib/lib
export LD_LIBRARY_PATH
THREADS_FLAG=native
export THREADS_FLAG


Have stopped and restarted DSEngine and ASBAgent


the variables values have been taken from server1 (set | grep -i db2)

DB2DIR=/opt/IBM/DB2
DB2INSTANCE=db2inst1
DB2LIB=/home/db2inst1/sqllib/lib
DB2_HOME=/home/db2inst1/sqllib
HISTFILE=/home/db2inst1/.bash_history
HOME=/home/db2inst1
IBM_DB_DIR=/home/db2inst1/sqllib
IBM_DB_INCLUDE=/home/db2inst1/sqllib/include
IBM_DB_LIB=/home/db2inst1/sqllib/lib
INSTHOME=/home/db2inst1
INST_DIR=/home/db2inst1/sqllib
LD_LIBRARY_PATH=/home/db2inst1/sqllib/lib64:/home/db2inst1/sqllib/lib32
LOGNAME=db2inst1
MAIL=/var/spool/mail/db2inst1
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/db2inst1/sqllib/bin:/home/db2inst1/sqllib/adm:/home/db2inst1/sqllib/misc:/home/db2inst1/bin


My test job is db2connector -> peek stage
Connection details are

Instance: db2inst1
Databse: xmeta
Username: db2inst1
Password : <db2inst1 password>

when I test connection I get
"The connection failed. The DB2 library couuld not be be loaded'

What have I missed the configuration?

Thanking you all in advance
ShaneMuir
Premium Member
Premium Member
Posts: 508
Joined: Tue Jun 15, 2004 5:00 am
Location: London

Post by ShaneMuir »

This post might help
viewtopic.php?p=422451
electajay
Participant
Posts: 36
Joined: Thu Apr 15, 2010 11:19 am

Post by electajay »

Db2 cataloging is needed if he is using db2api stage. But here he is using db2 connector stage.
A Kumar
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

DB2 connector will also use the catalog information. If you read the documentation that if DB2 client fails to connect to the server then DB2 Connector will also fail. Try to catalog xmeta on engine then try running the job again.
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
PaulVL
Premium Member
Premium Member
Posts: 1315
Joined: Fri Dec 17, 2010 4:36 pm

Post by PaulVL »

From the command line using dsadm:

source dsenv
then try executing the DB2 command to see if you can at least pull that up.

then list your cataloged databases (it's not a catalog issue, I just want to know if you can at least execute a command in DB2).
cppwiz
Participant
Posts: 135
Joined: Tue Sep 04, 2007 11:27 am

Post by cppwiz »

We just resolved the same issue here. Our resolution was to comment out other variable settings and add these lines at the end of the dsenv file:

INSTHOME=/home/db2inst1;export INSTHOME
DB2DIR=/opt/IBM/DB2; export DB2DIR
DB2INSTANCE=db2inst1;export DB2INSTANCE
PATH=$PATH:$INSTHOME/sqllib/bin:$DB2DIR/bin:;export PATH
LIBPATH=$LIBPATH:$INSTHOME/sqllib/lib64;export LIBPATH

Then, stop and restart the DataStage engine and ASB Node Agent:

Stop DataStage (you have to run this from $DSHOME)
. ./dsenv
bin/uv -admin -stop

Stop the ASB Agent (you need to be root here)
Go to <InstallPath>/IBM/InformationServer/ASBNode/bin
Run ./NodeAgents.sh stop

Then,

Start ASB Agent as root
Go to <InstallPath>/IBM/InformationServer/ASBNode/bin
Run ./NodeAgents.sh start

Start DataStage (as dsadm)
Go to $DSHOME
Run bin/uv -admin -start

This procedure resolved our issue.
ecclesr
Premium Member
Premium Member
Posts: 260
Joined: Sat Apr 05, 2003 7:12 pm
Location: Australia

Post by ecclesr »

priyadarshikunal wrote:DB2 connector will also use the catalog information. If you read the documentation that if DB2 client fails to connect to the server then DB2 Connector will also fail. Try to catalog xmeta on engine then try running the job again.
Are you able to provide the detailed commands steps I will need to do to catalog xmeta on the engine
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

I believe you will need to catalog both the remote node and the remote database on your engine computer.

Check the DB2 command documentation in the knowledge center for the exact syntax and command options.

It should look something like this:

Code: Select all

db2 catalog tcpip4 node <node name> remote <ip address> server <port>
db2 catalog database xmeta at node <node name>
Mike
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

Your original error looks like a library path issue to me (before the database catalog even comes into play).

Just to make sure we cover the obvious first: You have installed a DB2 client instance on your engine computer. Yes?

Mike
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

To see what you have catalogued currently:

Code: Select all

db2 list node directory

Code: Select all

db2 list database directory
Mike
ecclesr
Premium Member
Premium Member
Posts: 260
Joined: Sat Apr 05, 2003 7:12 pm
Location: Australia

Post by ecclesr »

Hi Mike

Looks like we are on the right track now

db2 list database directory works as expeted

When I excute db2 list node directory

I get "SQL1027N The node directory cannot be found"

So from Server1 (Repository,services) I need to issue the db2 catalog commands

db2 catalog database xmeta at node <node name> (Node name being?)

then

db2 catalog tcpip4 node <node name> remote <Server2 ip address>

is this right
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

You would issue the catalog commands on the engine server.

The node name would be the hostname of your repository server and the ip address would be that of your repository server. The port or service name would be whatever DB2 is listening on.

Mike
ecclesr
Premium Member
Premium Member
Posts: 260
Joined: Sat Apr 05, 2003 7:12 pm
Location: Australia

Post by ecclesr »

Mike I can start a DB2 session on Server1 (Repository,Services)
Logon to Repository server as root
su - db2inst1

I cannot start a db2 session on the Server2. Have I made a mistake during the installation on teh two servers
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Do you have a DB2 client installed on server 2 (engine)? I installed on Server 1 as repository is there in DB2 database created during installation. But did you install a client on Server 2 where engine resides?
Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
priyadarshikunal
Premium Member
Premium Member
Posts: 1735
Joined: Thu Mar 01, 2007 5:44 am
Location: Troy, MI

Post by priyadarshikunal »

Priyadarshi Kunal

Genius may have its limitations, but stupidity is not thus handicapped. :wink:
Post Reply