installing Oracle Instantclient on Mac OS/X without setting environment variables?

感情迁移 提交于 2019-11-27 19:11:35

Oracle's instantclient installation instructions specify that the user set DYLD_LIBRARY_PATH. This is very troublesome to manage for multiple users.

To use the instantclient without setting any environment variables:

Download the instantclient distribution from oracle.com. For doing non-java software development, you will need (assuming Oracle 10.2):

instantclient-basic-macosx-10.2.0.4.0.zip
instantclient-sdk-macosx-10.2.0.4.0.zip
instantclient-sqlplus-macosx-10.2.0.4.0.zip

Unzip the three files. This will give you a directory

instantclient_10_2/

Copy the files to /usr, which is one of the default places the dynamic loader searches.

sudo cp instantclient_10_2/sdk/include/*.h /usr/include
sudo cp instantclient_10_2/sqlplus         /usr/bin
sudo cp instantclient_10_2/*.dylib         /usr/lib

If you use tnsnames.ora, copy it to /etc, which is the default global place the oracle runtime searches.

sudo cp tnsnames.ora /etc

Test with

/usr/bin/sqlplus scott/tiger@myoracle

If your goal is simply to run sqlplus on your MacBook, this might work for you. Remove the DYLD_LIBRARY_PATH environment variable from ~/.bashrc and replace it with an alias:

alias sqlplus="DYLD_LIBRARY_PATH=/Applications/instantclient_11_2 sqlplus"

Blog entry: sqlplus and DYLD_LIBRARY_PATH on Mac OS/X

bluebinary

After much research I found an sustainable solution to this error, that involves editing Apache's launchd configuration .plist file to specify the required DYLD_LIBRARY_PATH, ORACLE_HOME, and LD_LIBRARY_PATH environment variables.

You can view the full answer here: https://stackoverflow.com/a/20670810/1914455

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!