Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

LD_LIBRARY_PATH_XX is it necessary

761017Aug 17 2010 — edited Aug 17 2010
Hi all,

I'm writing up some standards on Oracle builds within my organisation and I'm just wondering about the setting of the LD_LIBRARY_PATH.

Is it still necessary to set the parameter? There's alot of documentation that says it shoudl be set to the Oracle homes lib/lib64 based on the LD_LIBRARY_PATH_32/64 Parameter, but in a multi home environment I find it does cause problems as the oraenv command does not alter the parameter even when setting the path with the $ORACLE_HOME parameter. And usually, by unsetting these parameters, the problem resolves itself.

Therefore, should the LD_LIBRARY_PATH_XX be set or left blank?

The OS is Solaris 10 btw.

Thanks in advance.
This post has been answered by Pierre Forstmann on Aug 17 2010
Jump to Answer

Comments

Fahd.Mirza
Hi,
LD_LIBRARY_PATH variable is needed for some Oracle binaries such as sysresv. It is normally set to export LD_LIBRARY_PATH=$ORACLE_HOME/lib


regards
Rajesh Lathwal
please see if below MOs note might help :

Solaris: Setting LD_LIBRARY_PATH in 10gR1 and higher [ID 271451.1]

Regards
Rajesh
761017
Hi Fahd,

I tried that, and then when I did an oraenv, the value didn't change. So when I change from a 10.2.0 home to a 11.2.0 home, the LD_LIBRARY_PATH doesn't change causing issues when trying to simple commands like 'sqlplus / as sysdba'.

eg

$ set |grep LIBRA
LD_LIBRARY_PATH_32=/u01/app/oracle/product/11.2.0/dbhome_1/lib32:/usr/openwin/lib
LD_LIBRARY_PATH_64=/u01/app/oracle/product/11.2.0/dbhome_1/lib
$ . oraenv
ORACLE_SID = [TESTDB11G] ? TESTDB10G
$ set |grep LIBRA
LD_LIBRARY_PATH_32=/u01/app/oracle/product/11.2.0/dbhome_1/lib32:/usr/openwin/lib
LD_LIBRARY_PATH_64=/u01/app/oracle/product/11.2.0/dbhome_1/lib
$ ssdba
ld.so.1: sqlplus: fatal: relocation error: file /u01/app/oracle/product/10.2.0/Db_1/lib/libnnz10.so: symbol nzdacvalue: referenced symbol not found
Killed

in the profile i've set

export LD_LIBRARY_PATH_32=$ORACLE_HOME/lib32:/usr/openwin/lib
export LD_LIBRARY_PATH_64=$ORACLE_HOME/lib
user00726
LD_LIBRARY_PATH_64=$ORACLE_HOME/lib
export LD_LIBRARY_PATH_64
and vice versa for 32
Fahd.Mirza
Hi,
check the following at the metalink:

271451.1

regards
761017
Thanks for the metalink note. However, that only explains what I should set the parameter to.But how do I handle multiple homes?

Just to continue from my last post :

ORACLE_SID = [TESTDB11G] ? TESTDB10G
$ sqlplus '/ as sysdba'
ld.so.1: sqlplus: fatal: relocation error: file /u01/app/oracle/product/10.2.0/Db_1/lib/libnnz10.so: symbol nzdacvalue: referenced symbol not found
Killed
$ unset LD_LIBRARY_PATH_64
$ unset LD_LIBRARY_PATH_32
$ sqlplus '/ as sysdba'

SQL*Plus: Release 10.2.0.3.0 - Production on Tue Aug 17 10:43:13 2010

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SYS@TESTDB10G >


So i guess to restate the problem :-
If it is necessary to set the parameter, how are we handling multiple homes.
Has anyone had any problems from NOT setting the LD_LIBRARY_PATH in Oracle 10g and above?
Rajesh Lathwal
Normally It doesn't create any problem if you unset this parameter.

What you can do is , you can have different profiles for different ORACLE_HOME and set the environment accordingly.

Regards
Rajesh
Pierre Forstmann
Answer
user12553951 wrote:
how are we handling multiple homes.
This is taken care by shell script oraenv/coraenv installed by default in /usr/local/bin when installing Oracle.
Are you sure that these scripts don't set LD_LIBRARY_PATH. At least on Linux, they do:
$ grep LD_LIBRARY_PATH oraenv
# Reset LD_LIBRARY_PATH
case "$LD_LIBRARY_PATH" in
    *$OLDHOME/lib*)     LD_LIBRARY_PATH=`echo $LD_LIBRARY_PATH | \
    "")                 LD_LIBRARY_PATH=$ORACLE_HOME/lib ;;
    *)                  LD_LIBRARY_PATH=$ORACLE_HOME/lib:$LD_LIBRARY_PATH ;;
export LD_LIBRARY_PATH
Edited by: P. Forstmann on 17 août 2010 11:55
Marked as Answer by 761017 · Sep 27 2020
761017
Hi forstmann,

If you look at my post further up, I've listed an example of me getting the problem. I think it's about the 4th post down.

Saying that, I've had a quick look at the binaries, and I've found that the 10g version of Oraenv doesn't have that functionality, but the 11g version does.

So i'll get the admins to change the oraenv command from the version 10 to the version 11.

Thank you very much guys!
1 - 9
Locked Post
New comments cannot be posted to this locked post.

Post Details

Locked on Sep 14 2010
Added on Aug 17 2010
9 comments
2,389 views