Reputation: 493
I'm having a difficult time getting the Oracle 12.2.0.1.0-2 ODBC drivers and Instant Client (Basic Lite version) working with homebrew-installed unixODBC 2.3.5 under MacOS 10.12.6 (Sierra).
Extracting both of the Oracle ZIP files to /opt/ora12/instantclient_12_2
, creating symlinks for libclntsh.dylib
and libclntsh.dylib.12.1
, then pointing odcb to the /opt/ora/12/instantclient_12_2/libsqora.lib
gives a file not found error. While the path definitely exists and has good permissions, inspecting the dylib with otool -L
shows that the @rpath
directories are not finding the supporting libraries.
If I pull down the 12.2 sqlplus client, extract it to the same instantclient tree and run the binary, the CLI works fine. This seems to be some sort of dylib loading issue with odbc, but I'm not sure how to fix it. I've tried setting DYLIB_LIBRARY_PATH, copying all the libraries straight into /usr/local/lib
, all to no effect.
I've not yet tried to pull out install_name_tool
and hard coding search paths (getting further in the weeds than I've done before on MacOS) and I'm hoping something so drastic and non-portable isn't required. Is there a step to the install process I'm missing to get this working?
Thanks in advance!
Upvotes: 2
Views: 1485
Reputation: 493
After significant back and forth on the Oracle Community forums, the condensed solution is documented at this blog post: https://blogs.oracle.com/opal/installing-the-oracle-odbc-driver-on-macos?dd
In brief, the Oracle ODBC supplied odbc_update_ini.sh
needs to be ran after first patching to change the reference from libsqora.so.12.1
to libsqora.dylib.12.1
. Two libraries (libclntsh.dylib.12.1
and libclntshcore.dylib.12.1
) then need to be symlinked into a library location on your PATH (I used /usr/local/lib
).
With the above config (using the Basic client instead of Basic Lite, though Basic Lite should work) and the necessary tnsnames.ora
black magic (TNS connection strings are covered in many other SO questions), I was able to connect both with command line isql and with my true goal, R's odbc
and DBI
using unixODBC.
Upvotes: 4