Linux下配置Oracle呼叫介面OCI及我碰到的一些問題
阿新 • • 發佈:2019-02-04
本人裝的是Version 11.2.0.4.0 ,所以一下都是以Version 11.2.0.4.0 為例子,系統是CentOS 7.3
1、首先下載好必備的包
2、
安裝alien
yum -y install alien (非root請加許可權,下同)
將rmp轉為deb
安裝轉換完的deb,如沒有dpkg,請自行安裝
我安裝好的位置分別在(資料夾名可能不同)
/usr/lib/oracle/11.2/client64/lib
/usr/include/oracle/11.2/client64
4、安裝配置OCI(根據自己的自行修改)
./configure --with-oracle-lib-path=/usr/lib/oracle/11.2/client64/lib --with-oracle-headers-path=/usr/include/oracle/11.2/client64
make
make install
5、之後編譯自己的程式碼是出現的錯誤(類似的錯誤,也可以試試這個解決方法)
①/usr/bin/ld: warning: libclntsh.so.11.1, needed by /usr/local/lib/libocilib.so, not found (try using -rpath or -rpath-link)
在/etc/ld.so.conf中新增 /home/oracle/cry/instantclient_11_2 後正常.(instantclient_11_2 這個檔案就是上面的zip解壓出來的) ②./tests: error while loading shared libraries: xxx.so.0:cannot open shared object file: No such file or directory 出現這類錯誤表示,系統不知道xxx.so放在哪個目錄下,這時候就要在/etc/ld.so.conf中加入xxx.so所在的目錄。