简介:
python 连接Oracle 过程总结(Linux)
下载Oracle客户端:
下载地址:http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
需要注册
下面几个(py27代表python2.7版本):
cx_Oracle-5.1.2-11g-py27-1.x86_64.rpm (https://sourceforge.net/projects/cx-oracle/files/)
instantclient-basic-linux.x64-12.1.0.2.0.zip
instantclient-sdk-linux.x64-12.1.0.2.0.zip
安装过程:
1.安装包
$unzip instantclient-basic-linux.x64-12.1.0.1.0.zip $sudo cp -r instantclient_12_1 /opt unzip instantclient-sdk-linux.x64-12.1.0.2.0.zip cp sdk instantclient_12_1 $vi /etc/profile export ORACLE_HOME=/opt/instantclient_12_1 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME $source /etc/profile
2.用PIP安装
pip install cx_Oracle
连接方法: