您的位置:首页 > 数据库 > Oracle

Linux下安装python cx_Oracle

2016-01-14 14:08 537 查看
1.下载oracleinstantclient-basichttp://download.oracle.com/otn/linux/instantclient/112020/instantclient-basic-linux-x86-64-11.2.0.2.0.zip
2.安装配置oracleinstantclient
unzipinstantclient-basic-linux-x86-64-11.2.0.2.0.zipcp-rfinstantclient_11_2/opt/vi/root/.bash_profileexportORACLE_HOME=/opt/instantclient_11_2exportLD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOMEsource/root/.bash_profile
 
如果机器上本来就有oracle,已经存在<spanstyle="font-family:Arial,Helvetica,sans-serif;">$ORACLE_HOME/instantclient </span>,那么只需要将<spanstyle="font-family:Arial,Helvetica,sans-serif;">instantclient_11_2中的内容,拷贝到现有的instantclient目录。</span>
<spanstyle="font-family:Arial,Helvetica,sans-serif;">但是要记得更新</span><spanstyle="font-family:Arial,Helvetica,sans-serif;">LD_LIBRARY_PATH</span>
==>比如:export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME/instantclient 
<prename="code"class="html"><pstyle="margin-top:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;font-family:Arial;line-height:26px;"><spanstyle="font-size:10px;">cd$ORACLE_HOME</span></p><pstyle="margin-top:0px;margin-bottom:0px;padding-top:0px;padding-bottom:0px;font-family:Arial;line-height:26px;"><spanstyle="font-size:10px;">ln-slibclntsh.so.11.1libclntsh.so</span></p>
3.downloadandinstallcx_Oracle-5.1.2.tar.gz
从<atarget=_blankhref="http://cx-oracle.sourceforge.net/"rel="nofollow"style="color:rgb(53,114,176);font-family:Arial,sans-serif;font-size:14px;line-height:20px;white-space:nowrap;">http://cx-oracle.sourceforge.net/</a>下载
tarxzvfcx_Oracle-5.1.2.tar.gz
pythonsetup.pybuild
pythonsetup.pyinstall
4.验证$python>>importcx_Oracle

                                            
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: