现在的位置: 首页 > 综合 > 正文

cx_Oracle的配置啊。。终于搞出来了

2013年10月05日 ⁄ 综合 ⁄ 共 1203字 ⁄ 字号 评论关闭

参考。。

http://www.blogjava.net/jelver/articles/294583.html

http://shanchao7932297.blog.163.com/blog/static/1363624200710911543428/

http://aofengblog.blog.163.com/blog/static/6317021201157111336764/

http://www.cnblogs.com/ysisl/archive/2010/12/20/1911870.html

python

import cx_Oracle再也不会报错了。。

记录一下:

环境是AS 5 32BIT的。。 oracle是10.1 ptyhon 自带的是 2.4

下载的cx_Oracle-5.0-10g-py24-1.i386.rpm  还是这个靠谱。。src source的install总是有问题。。还是rpm靠谱

因为本身这个linux装了oracle客户端 所以先修改环境变量

vi /root/.bash_profile
----------- cx_Oracle的官网上面写的 .profile文件 根本找不到嘛。。

      1 # .bash_profile
      2 
      3 # Get the aliases and functions
      4 if [ -f ~/.bashrc ]; then
      5         . ~/.bashrc
      6 fi
      7 
      8 # User specific environment and startup programs
      9 
     10 PATH=$PATH:$HOME/bin
     11 
     12 export PATH
     13 export ORACLE_HOME=/opt/app/oracle/product/10.2
     14 export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME
     15 
     16 export TNS_ADMIN=/opt/app/oracle/product/10.2
     17 unset USERNAME
                                                                             
"~/.bash_profile" 17L, 339C

source /root/.bash_profile 软链接

cd $ORACLE_HOME -------进入10.2目录

ln -s libclntsh.so.10.1 libclntsh.so 
--链接
[root@Gray temp]# rpm -ivh --nodeps cx_Oracle-5.0-10g-py24-1.i386.rpm
-重新安装cx..

[root@Gray temp]# python
Python 2.4.3 (#1, Jun 11 2009, 14:09:58) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>> 

不报错了。。哦也

抱歉!评论已关闭.