在 Mac OS/X 上安装 Oracle Instantclient 而不设置环境变量?
Oracle 的指令指定设置 DYLD_LIBRARY_PATH。 这使得我的应用程序依赖于随机用户的配置,并且设置起来非常麻烦。
如何避免设置任何环境变量?
http://www.oracle.com/technology/ software/tech/oci/instantclient/htdocs/intel_macsoft.html
Linux 相关说明:在 Linux 上安装 Oracle Instantclient 而不设置环境变量?
Oracle's instructions specify setting DYLD_LIBRARY_PATH. This makes my application dependent on random users' configuration and is very troublesome to set up.
How can I avoid having to set any environment variables?
http://www.oracle.com/technology/software/tech/oci/instantclient/htdocs/intel_macsoft.html
related note for linux: installing Oracle Instantclient on Linux without setting environment variables?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
Oracle的instantclient安装指令指定用户设置DYLD_LIBRARY_PATH。 这对于多个用户来说管理起来非常麻烦。
要在不设置任何环境变量的情况下使用 instantclient:
从 oracle.com 下载 instantclient 发行版。 对于进行非 java 软件开发,您将需要(假设 Oracle 10.2):
解压缩这三个文件。 这将为您提供一个目录,
将文件复制到 /usr,这是动态加载程序搜索的默认位置之一。
如果您使用 tnsnames.ora,请将其复制到 /etc,这是 oracle 运行时搜索的默认全局位置。
测试用
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):
Unzip the three files. This will give you a directory
Copy the files to /usr, which is one of the default places the dynamic loader searches.
If you use tnsnames.ora, copy it to /etc, which is the default global place the oracle runtime searches.
Test with
如果您的目标只是在 MacBook 上运行 sqlplus,那么这可能适合您。 从 ~/.bashrc 中删除 DYLD_LIBRARY_PATH 环境变量并将其替换为别名:
alias sqlplus="DYLD_LIBRARY_PATH=/Applications/instantclient_11_2 sqlplus"
博客条目:Mac OS/X 上的 sqlplus 和 DYLD_LIBRARY_PATH
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
经过大量研究,我找到了解决此错误的可持续解决方案,其中涉及编辑 Apache 的
launchd
配置.plist
文件以指定所需的DYLD_LIBRARY_PATH
、ORACLE_HOME
和LD_LIBRARY_PATH
环境变量。您可以在此处查看完整答案:https://stackoverflow.com/a/20670810/1914455
After much research I found an sustainable solution to this error, that involves editing Apache's
launchd
configuration.plist
file to specify the requiredDYLD_LIBRARY_PATH
,ORACLE_HOME
, andLD_LIBRARY_PATH
environment variables.You can view the full answer here: https://stackoverflow.com/a/20670810/1914455