1 Reply Latest reply: Mar 22, 2013 1:44 AM by 775132 RSS

    OSX 10.8.3 sqlplus Can't Load Oracle Build-Box's libsqlplus.dylib

      My mac:
      uname -a
      Darwin rjp 12.3.0 Darwin Kernel Version 12.3.0: Sun Jan 6 22:37:10 PST 2013; root:xnu-2050.22.13~1/RELEASE_X86_64 x86_64

      When I type "sqlplus", I get:

      dyld: Library not loaded: /ade/b/2649109290/oracle/sqlplus/lib/libsqlplus.dylib
      Referenced from: /opt/oracle/ic_11_2_64bit/sql_plus/sqlplus
      Reason: image not found
      zsh: trace trap sql_plus/sqlplus

      I'm I Rails developer, and when I start Rails I get the same problem. For Rails, I have to use the ruby-oci8 gem, which uses the OCI lib.

      I'm guessing that "/ade/b/2649109290" is some path on the machine Oracle used to build "libsqlplus"?

      My first guess as to how my system sees the build machine's path is if some library is statically linked...

      Looking for the longest part of the build-box's path in my oracle instantclient dir...

      strings * | grep 2649109290

      Small timezone file = /ade/b/2649109290/oracle/oracore/zoneinfo/timezone_14.dat

      Large timezone file = /ade/b/2649109290/oracle/oracore/zoneinfo/timezlrg_14.dat


      So there is some file with at static path in that dir, right?

      Check each file one-by-one, and get a hit only on this one:
      strings libociicus.dylib | grep 2649109290

      Is that file statically linked? No...
      file libocci.dylib.11.1
      libocci.dylib.11.1: Mach-O 64-bit dynamically linked shared library x86_64

      I don't get it... Did somebody simply hard code the path, even though it's dynamically linked?
      Maybe somebody with access to the source code would recognize the problem from:
      nm libociicus.dylib
      U _OCISharedLibInit
      U ___assert_rtn
      0000000000967d70 s ___func__.8465
      U ___stack_chk_fail
      U ___stack_chk_guard
      0000000000000704 t __dyld_func_lookup
      U _bsearch
      0000000000000b00 s _ociicusFileBuffer
      0000000000000930 T _ociicusGetFileBuffer
      0000000000000870 T _ociicusGetFileName
      0000000000000710 T _ociicusGetNumFiles
      00000000000007e0 T _ociicusInit
      0000000000000730 T _ociicusInitSrcOff
      00000000000008e0 t _ociicusNameCompare
      0000000000968070 b _ociicusSrcOff
      0000000000968060 s _ociicusdctx
      U _strcmp
      U dyld_stub_binder
      00000000000006f0 t dyld_stub_binding_helper
        • 1. Re: OSX 10.8.3 sqlplus Can't Load Oracle Build-Box's libsqlplus.dylib
          I assume you are trying to use the Oracle Database Instant client on the latest Mountain Lion ( 10.8.3 ) release . The static path gets recorded in the binaries and thats what you see when you run otool and through other tools . You should be setting DYLD_LIBRARY_PATH pointing to the unzipped directories comtaining the client libraries . This would enable it to pick the correct library at runtime and should resolve the issue. Please read the documentation for more information.

          PS : Oracle 11gR2 on Mac OS X was certified on Lion and Mountain Lion 10.8.2 , though it should work fine unless there are some changes which break compatibility.