http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html---下载instantclient-basic-linux.x64-11.2.0.4.0
http://sourceforge.net/projects/cx-oracle/files/5.1.2/----下载cx_Oracle-5.1.2.tar.gz
https://pypi.python.org/pypi/cx_Oracle----下载cx_Oracle-5.1.2.tar.gz
linux版本号 CentOS release 6.5 (Final)
python版本号 2.6.6
oracle版本号 11.2.0.4 x86_64 1、安装oracle客户端和sdk
# unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
# cp ~/instantclient_11_2/* /usr/local/oracle_instantclient_11.2.0.4_x86_64/<pre name="code" class="cpp">http://www.oracle.com/technetwork/topics/linuxx86-64soft-092277.html---下载instantclient-basic-linux.x64-11.2.0.4.0
http://sourceforge.net/projects/cx-oracle/files/5.1.2/----下载cx_Oracle-5.1.2.tar.gz
https://pypi.python.org/pypi/cx_Oracle----下载cx_Oracle-5.1.2.tar.gz
linux版本号 CentOS release 6.5 (Final)
python版本号 2.6.6
oracle版本号 11.2.0.4 x86_64 1、安装oracle客户端和sdk
# unzip instantclient-basic-linux.x64-11.2.0.4.0.zip
# cp ~/instantclient_11_2/* /usr/local/oracle_instantclient_11.2.0.4_x86_64/ # unzip instantclient-sdk-linux.x64-11.2.0.4.0.zip -d /usr/local/oracle_instantclient_11.2.0.4_x86_64/
# cp -rf include/* /usr/local/oracle_instantclient_11.2.0.4_x86_64/ 2、环境变量设置
# vi /etc/profile
export ORACLE_HOME=/usr/local/oracle_instantclient_11.2.0.4_x86_64
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$ORACLE_HOME:/lib:/usr/lib # source /etc/profile 3、安装cx_oracle
# tar xvf cx_Oracle-5.1.2.tar.gz
# ln -sv /usr/local/oracle_instantclient_11.2.0.4_x86_64/libclntsh.so.11.1 /usr/local/oracle_instantclient_11.2.0.4_x86_64/libclntsh.so
# python setup.py build
# python setup.py install
Installed /usr/lib64/python2.6/site-packages/cx_Oracle-5.1.2-py2.6-linux-x86_64.egg
Processing dependencies for cx-Oracle==5.1.2
Finished processing dependencies for cx-Oracle==5.1.2 4、成功安装后进行验证
>>> import cx_Oracle 问题
1、 raise DistutilsSetupError("cannot locate an Oracle software " \
解决:须要设置oracle的环境变量LD_LIBRARY_PATH 2、cx_Oracle.c:10:17: 错误:oci.h:没有那个文件或文件夹
解决:安装oracle jdk 3、/usr/bin/ld: cannot find -lclntsh
解决:创建软链接
ln -sv /usr/local/oracle_instantclient_11.2.0.4_x86_64/libclntsh.so.11.1 /usr/local/oracle_instantclient_11.2.0.4_x86_64/libclntsh.so 4、cx_Oracle.DatabaseError: ORA-00972: identifier is too long和打印的中文字段名为??? ? # export NLS_LANG="SIMPLIFIED CHINESE_CHINA.ZHS16GBK" ##攻克了一部分问题
# export NLS_LANG="SIMPLIFIED CHINESE_CHINA.UTF8" ##全然攻克了问题


python使用cx_oracle连接oracle数据库的更多相关文章

  1. python使用cx_Oracle连接oracle

    1.使用pip命令安装cx_Oracle $ pip install cx_Oracle 2.安装oracle客户端,并添加到path 下载路径: http://www.oracle.com/tech ...

  2. Python3安装cx_Oracle连接oracle数据库实操总结

    弄清版本,最重要!!! 首先安装配置时,必须把握一个点,就是版本一致!包括:系统版本,python版本,oracle客户端的版本,cx_Oracle的版本,然后安装配置就容易了! 如果已经安装Pyth ...

  3. python用cx_Oracle连接oracle

    确认版本: oracle版本:64位 python版本:64位 下载cx_Oracle的whl包:64位 安装whl包:pip install wheel cd到下载路径安装cx_Oracle的whl ...

  4. 在PYTHON中,用cx_Oracle连接ORACLE数据库简单示例

    一,在安装的时候,参数有点不一样: python setup.py build install 二,连接数据库,有两种方式,DSN和TNSNAMES方式: #dsn = orcl.makedsn(se ...

  5. Python 连接 Oracle数据库

    1.环境设置 [root@oracle ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@oracle ~]# python - ...

  6. Python 连接Oracle数据库

    连接:python操作oracle数据库  python——连接Oracle数据库 python模块:cx_Oracle, DBUtil 大概步骤: 1. 下载模块 cx_Oracle (注意版本) ...

  7. Python + cx_Orcale 连接Oracle数据库

    这是我在使用python连接Oracle数据库时遇到的问题.在此做一下总结. 1.pip install cx_Oracle 2.然后还需要在下载一个数据库客户端工具instantclient-bas ...

  8. python连接oracle数据库报错"DatabaseError: DPI-1047: 64-bit Oracle Client library cannot be loaded: "解决方案

    操作系统,python3.5, oracle_11, 均为64位:plsql 正常连接. 也顺利安装了cx_oracle 6.3,但是python进行连接的时候就会报错"DatabaseEr ...

  9. 【python】python连接Oracle数据库

    python连接Oracle数据库 查看Oracle版本 select * from v$version 下载对应版本的InstantClient 下载网址 InstantClient 1.解压Ins ...

随机推荐

  1. Relay Race (DP)

    Furik and Rubik take part in a relay race. The race will be set up on a large square with the side o ...

  2. Codeforces Round #415 (Div. 2) 翻车啦

    A. Straight «A» time limit per test 1 second memory limit per test 256 megabytes input standard inpu ...

  3. 【UML】9种图+包图

    导读:在UML的学习中,介绍了9种图,外加一个包图.这9种图和4大关系,可以说是UML的一个核心内容.我根据自己的笔记,以及查阅的一些资料,对这9种图和包图,做一个总结. 一.基本定义 1.1  总体 ...

  4. BZOJ-1303 中位数图

    先找到B的位置x,然后依次统计A[i..x-1](0<i<x)中小于B的个数,和A[x+1..i](x<i<n)中大于B的个数 最后Answer等于(左边有i个小于B的情况总数 ...

  5. 648. Replace Words

    Problem statement In English, we have a concept called root, which can be followed by some other wor ...

  6. Mysql安装及自动化部署脚本方案

    一.简介 数据库(Database)是按照数据结构来组织.存储和管理数据的仓库, 每个数据库都有一个或多个不同的API用于创建,访问,管理,搜索和复制所保存的数据. 我们也可以将数据存储在文件中,但是 ...

  7. Linux系统下rz/sz工具的安装

    (1)编译安装 root 账号登陆后,依次执行以下命令: wget http://www.ohse.de/uwe/releases/lrzsz-0.12.20.tar.gz tar zxvf lrzs ...

  8. go--常量&运算符

    常量const 1.常量声明: const ( a = b c ) fmt.Println(a) fmt.Println(b) fmt.Println(c)// ======222 ====: 2.并 ...

  9. 动态规划—最长回文子串LEETCODE第5题深度剖析

    动态规划对于笔者来说有很重要的意义 一.题目如下: 对于此类题目,笔者常用的的办法是先做个暴力解题思路,然后再对暴力法进行优化. 二.暴力法 //字串遍历 public static String l ...

  10. php执行超时(nginx,linux环境)

    与下面的参数有关 nginx: fastcgi_connect_timeout fastcgi_read_timeout fastcgi_send_timeout php-fpm:request_te ...