准备:
1、下载对应版本的oracle-instantclient(我这里是11.2.0.1.0)
http://www.oracle.com/technetwork/database/features/instant-client/index-097480.html
2、安装
rpm -ivh oracle-instantclient11.2-basic-11.2.0.1.0-1.x86_64.rpm
3、配置环境变量
export LD_LIBRARY_PATH=/usr/lib/oracle/11.2/client64/lib:$LD_LIBRARY_PATH
export PATH=/usr/lib/oracle/11.2/client64/bin:$PATH
4、开始你的开发(我们用python)
开发:
python连接oracle数据库需要cx_Oracle
1、下载
http://sourceforge.net/projects/cx-oracle/
2、安装
我下载rpm包,安装很简单
rpm -ivh cx_Oracle-5.1.2-11g-py26-1.x86_64.rpm
3、开始你的开发吧
Python 2.6.6 (r266:84292, Jan 22 2014, 09:42:36)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>>
时间: 2024-10-20 18:04:42