7 Replies Latest reply: Feb 27, 2013 9:18 PM by Girish Sharma RSS

    LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH

    yxes2013
      Hi All

      10.2.0.4
      SLES 11
      LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
      export LD_LIBRARY_PATH
      I 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,

      zxy
        • 1. Re: LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
          CKPT
          yxes2013 wrote:
          Hi All

          10.2.0.4
          SLES 11
          LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
          export LD_LIBRARY_PATH
          I 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,

          zxy
          Here is all about LD_LIBRARY_PATH
          http://linuxmafia.com/faq/Admin/ld-lib-path.html
          • 2. Re: LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
            yxes2013
            Yikes! is this a reliable source dear? :(

            I can't believe that its advise is NEVER set it :) , when I saw some oracle documentation recommending this LD thing too.
            • 3. Re: LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
              CKPT
              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
              >
              source
              What is LD_LIBRARY_PATH env variable for?
              • 4. Re: LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
                yxes2013
                So the "rule of thumb" is if your script works without it(LD) then forget it. ;)
                • 5. Re: LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
                  Girish Sharma
                  yxes2013 wrote:
                  So the "rule of thumb" is if your script works without it(LD) then forget it. ;)
                  No, because please re-read what Billy is saying :
                  "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.

                  Regards
                  Girish Sharma
                  • 6. Re: LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
                    yxes2013
                    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
                    It says conditional "if my script fails"....but the thing is It did not fail, so forget this LD thing now. :)
                    • 7. Re: LD_LIBRARY_PATH=$ORACLE_HOME/lib:$PATH
                      Girish Sharma
                      yxes2013 wrote:
                      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
                      It says conditional "if my script fails"....but the thing is It did not fail, so forget this LD thing now. :)
                      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.

                      Regards
                      Girish Sharma