从oracle下载的几个包解压即可使用,但是这几个包如果不想安装在系统默认的/usr/bin和/usr/lib目录的话,就会有shared library找不到的问题了。参考了这篇文章修复此问题。
其中文中提到的script我运行后是有问题的,原因是因为install_name_tool的版本不对,换成xcode中的command line tool里面的版本就好了。所以更新script如下:
[code]
#!/bin/sh
# script to change the dynamic lib paths and ids for oracle instant client
# exes and libs
# proces all the executable files in this directory
find . -maxdepth 1 -type f \( -perm -1 -o \( -perm -10 -o -perm -100 \) \) -print | while read exe
do
echo adjusting executable $exe
baseexe=`basename $exe`
echo baseexe is $baseexe
otool -L $exe | awk ‘/oracle/ {print $1}’ | while read lib
do
echo adjusting lib $lib
baselib=`basename $lib`
echo baselib is $baselib
if [ “$baseexe” = “$baselib” ]
then
echo changing id to $baselib for $exe
/Applications/Xcode.app/Contents/Developer/usr/bin/install_name_tool -id $baselib $exe
else
echo changing path id for $lib in $exe
/Applications/Xcode.app/Contents/Developer/usr/bin/install_name_tool -change $lib @executable_path/$baselib $exe
fi
done
done
[/code]