oracle - DBD::Oracle unable to connect due to OCIEnvNlsCreate error on MacOS 10.12.6
问题描述
I'm trying to connect to an Oracle server in a Perl script. The script works on other machines that are already configured. I'm trying to set up my machine to allow me to do local development.
I have extracted instantclient-basic-macos.x64-11.2.0.4.0.zip
, instantclient-sqlplus-macos.x64-11.2.0.4.0.zip
, instatnclient-sdk-macos.x64-11.2.0.4.0.zip
, and instantclient-jdbc-macos.x64-11.2.0.4.0.zip
to /usr/local/oracle_client
. I have added that location to my PATH
, ORACLE_HOME
, LD_LIBRARY_PATH
, and DYLD_LIBRARY_PATH
environment variables via both .bashrc
and .bash_profile
in an attempt to find a fix. I have added the variables to the Perl script environment directly by setting them directly in the script:
$ENV{'ORACLE_HOME'} = '/usr/local/oracle_client';
$ENV{'LD_LIBRARY_PATH'} = $ENV{'ORACLE_HOME'};
$ENV{'DYLD_LIBRARY_PATH'} = $ENV{'ORACLE_HOME'};
I have reinstalled DBD::Oracle multiple times with various environment configurations. I can connect to the database using the sqlplus
client installed to /usr/local/oracle_client
.
Inside /usr/local/oracle_client
, I have created symlinks for bin
and lib
pointing to the /usr/local/oracle_client
dir (bin -> .
). The SDK also lives inside a subdirectory structure located at /usr/local/oracle_client/sdk
, but all of the include files have been copied to the /usr/local/oracle_client folder.
What am I missing?
解决方案
推荐阅读
- flutter - 如何在每种颜色的中心添加文字?
- python - ExtensionFailed JSONDecodeError:预期值:第 1 行第 1 列(字符 0)
- python - 为什么我在 openCV ::CascadeClassifier::detectMultiScale 中出现错误?
- jenkins - Cypress & Jenkins:通过 Jenkinsfile 安装系统依赖“xvfb”
- apache-spark - 通过 --files 提供给 Spark 时如何重命名文件
- activerecord - Yii2 通过联结表取消链接记录
- mongodb - 如何在 mongodb 上汇总聚合?
- javascript - React Native - 如何在两个单词之间创建动态虚线(引线)?
- java - 在 WebView 中打开 Android 中的本地 PDF
- python - fit(X,y) 错误:未知标签类型:数组