下载相应版本的cx_Oracle

安装cx_Oracle-5.1.2-11g-py24-1.x86_64.rpm,其他版本类似,

rpm -ivh  cx_Oracle-5.1.2-11g-py24-1.x86_64.rpm


安装简单,但需要配置下面的环境变量和软连接

在/etc/profile,添加

export LD_LIBRARY_PATH=/usr/lib/oracle/12.1/client64/lib/

然后创建软连接

ln -s /usr/lib/oracle/12.1/client64/lib/libclntshcore.so.12.1  /lib64/libclntshcore.so.12.1          

ln -s /usr/lib/oracle/12.1/client64/lib/libclntsh.so.12.1      /lib64/libclntsh.so.12.1

ln -s /usr/lib/oracle/12.1/client64/lib/libclntsh.so.11.1      /lib64/libclntsh.so.11.1       

ln -s /usr/lib/oracle/12.1/client64/lib/libipc1.so             /lib64/libipc1.so 

ln -s /usr/lib/oracle/12.1/client64/lib/libmql1.so             /lib64/libmql1.so                         

ln -s /usr/lib/oracle/12.1/client64/lib/libnnz12.so            /lib64/libnnz12.so             

ln -s /usr/lib/oracle/12.1/client64/lib/libocci.so.12.1        /lib64/libocci.so.12.1         

ln -s /usr/lib/oracle/12.1/client64/lib/libociei.so            /lib64/libociei.so             

ln -s /usr/lib/oracle/12.1/client64/lib/libocijdbc12.so        /lib64/libocijdbc12.so         

ln -s /usr/lib/oracle/12.1/client64/lib/libons.so              /lib64/libons.so               

ln -s /usr/lib/oracle/12.1/client64/lib/liboramysql12.so       /lib64/liboramysql12.so        

ln -s /usr/lib/oracle/12.1/client64/lib/ojdbc6.jar             /lib64/ojdbc6.jar              

ln -s /usr/lib/oracle/12.1/client64/lib/ojdbc7.jar             /lib64/ojdbc7.jar              

ln -s /usr/lib/oracle/12.1/client64/lib/xstreams.jar           /lib64/xstreams.jar