zoukankan      html  css  js  c++  java
  • install cx_Oracle on Linux

    step 1 : install oracle client library

        url: http://www.oracle.com/technetwork/topics/linuxsoft-082809.html

       or search:  instant clients download for Linux x86

       download:    instantclient-basic-linux-version.zip   # choose your version !!!!

                           instantclient-sdk-linux-version.zip     # header files to compile cx_Oracle

      unzip them to one directory (./libclntsh.so ./include ./admin .....)

    step 2: config enviroment variables

        export ORACLE_HOME=/path/to/instantclient   # must

        config LD_LIBRARY_PATH ( i used it but failed, so i edit file /etc/ld.so.conf)

        after edit ld.so.conf file, you need run ldconfig (as root)

    step 3: install cx_Oracle

      prepare: Python.h

               yum install python-devel or  apt-get install python-dev

     cause "/usr/bin/ld: cannot find -lclntsh", you need do this 

               cd $ORACLE_HOME

               ln -s libclntsh.so.version libclntsh.so # repalce version to right num

    now you can do this:

            pip install cx_Oracle

    Use Binary Way ( like windows ):

    Files: https://pypi.python.org/pypi/cx_Oracle  http://sourceforge.net/projects/cx-oracle/

    Test:

    import cx_Oracle
    
    cx_Oracle.connect('username','password','host/service_name',cx_Oracle.SYSDBA)
    

      

    Good Luck

  • 相关阅读:
    C#24种设计模式汇总
    传智播客C++视频学习笔记(5)
    传智播客C++视频学习笔记(3)
    传智播客C++视频学习笔记(1)
    Learning hard 网络编程
    Learning hard 学习笔记
    男人和女人 访问者模式
    其实你不懂老板的心 解释器模式
    项目多也别傻做 享元模式
    git常用命令
  • 原文地址:https://www.cnblogs.com/i2u9/p/cx_oracle.html
Copyright © 2011-2022 走看看