我想在Mac上安装sqlplus。所以,首先我从此链接下载了两个文件 https://www.oracle.com/technetwork/topics/intel-macsoft-096467.html这两个文件:
instantclient-basic-macos.x64-18.1.0.0.0.zip
instantclient-sqlplus-macos.x64-18.1.0.0.0.zip
然后,我将这些files.zip移至桌面和终端 我写了这些命令:
unzip /Users/adrianagiuliano/Desktop/instantclient-basic-macos.x64-18.1.0.0.0.zip
和
unzip /Users/adrianagiuliano/Desktop/instantclient-sqlplus-macos.x64-18.1.0.0.0.zip
然后:
export PATH=/Users/adrianagiuliano/Desktop/instantclient_18_1:$PATH
和:
which sqlplus
现在,当我尝试使用命令sqlplus
启动sqlplus时,出现以下消息:
dyld: Library not loaded: @rpath/libclntsh.dylib.18.1
Referenced from: /Users/adrianagiuliano/Desktop/instantclient_18_1/sqlplus
Reason: image not found
Abort trap: 6
为什么?如何解决?
非常感谢!
答案 0 :(得分:1)
The error suggests that your ~/Desktop/instantclient_18_1
directory only has the contents of the instantclient-sqlplus-macos.x64-18.1.0.0.0.zip
file. I suspect you've tried this several times from various locations, and you've ended up with a mix of partial and full installations, and you're happening to pick up a partial one.
When you do:
unzip /Users/adrianagiuliano/Desktop/instantclient-basic-macos.x64-18.1.0.0.0.zip
unzip /Users/adrianagiuliano/Desktop/instantclient-sqlplus-macos.x64-18.1.0.0.0.zip
then both zip archives should be expanded into the same instantclient_18_1
directory, which will be in your current working directory. If you didn't change to ~/Desktop
before running then that could be anywhere...
I'd suggest you start again. Find and remove any directories called instantclient_18_1
, from your home directory, ~/Desktop
, ~/Downloads
etc., anywhere you can find them; mostly just to avoid confusion.
Then, since your zip files are currently on the desktop, for simplicity for now do:
cd ~/Desktop
unzip instantclient-basic-macos.x64-18.1.0.0.0.zip
ls instantclient_18_1 | wc -l
unzip instantclient-sqlplus-macos.x64-18.1.0.0.0.zip
ls instantclient_18_1 | wc -l
The first ls
should give you a count of 18 files. The second should give you a count of 23 files.
Once you have done that then sqlplus
should work, using the PATH
you've already modified.
You can put that instantclient_18_1
directory anywhere you want, as long as your PATH
refers to it, and you can add setting your path to your ~/.bash_profile
file so you don't have to do that manually in future.
答案 1 :(得分:1)
如有疑问,请遵循从中下载Instant Client的页面上的installation instructions。总结:
cd ~
unzip instantclient-basic-macos.x64-18.1.0.0.0.zip
unzip instantclient-sqlplus-macos.x64-18.1.0.0.0.zip
mkdir ~/lib
ln -s ~/instantclient_18_1/libclntsh.dylib ~/lib/
export PATH=~/instantclient_18_1:$PATH
您错过的步骤是创建符号链接。自从Apple的SIP中断DYLD_LIBRARY_PATH以来,您就需要将Oracle Client lib放在~/lib
或/usr/local/lib
中。