This content has been marked as final. Show 7 replies
yxes2013 wrote:Here is all about LD_LIBRARY_PATH
LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATHI see this in some of the backup scripts documentations from previous dba. What is the purpose of this?
I have scripts too but it still runs good even if i do not specify this LD thing.
Need your advise.
Thanks a lot,
This is must read thread, Am going through it.
read comments from Billy,
The LD_LIBRARY_PATH variable fits into this as the means to find and resolve the shared lib reference for loading of shared libraries. The load library call (whether called statically by the kernel when loading your executable, or called dynamically from within your loaded executable) needs to find the relevant shared lib on disk. And this environment variable determines where to look on disk for the physical library module to load.
Whether LD_LIBRARY_PATH is needed or not depends on how the dynamic link loader of the kernel works ito determing where to look for a shared lib.
The Windows dynamic link loader uses the PATH variable (after checking the current dir first). It seems from the test below that Linux needs the LD_LIBRARY_PATH set
What is LD_LIBRARY_PATH env variable for?
yxes2013 wrote:No, because please re-read what Billy is saying :
So the "rule of thumb" is if your script works without it(LD) then forget it. ;)
"Whether LD_LIBRARY_PATH is needed or not depends on how the dynamic link loader of the kernel works ito determing where to look for a shared lib."
It means, if your script is addressing any shared library function and if kernel's dynamic link loader is not able to find the shared library then your script will fail, because you are going to access the shared library and your OS's dynamic link loader is not determining how and where to find it. So, it depend on OS and script which is asking to access shared library.
yxes2013 wrote:Yes, you can, but should not, because reading and learning about LD path is not a big deal, but may be "big deal" in future i.e. more helpful if you till then learn about it by just googling about it and reading couple of good links for sure.
It means, if your script is addressing any shared library function and if kernel's dynamic link loader is not able to find the shared library then your script will failIt says conditional "if my script fails"....but the thing is It did not fail, so forget this LD thing now. :)