python使用cx_oracle连接oracle数据库
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数据库的更多相关文章
- python使用cx_Oracle连接oracle
1.使用pip命令安装cx_Oracle $ pip install cx_Oracle 2.安装oracle客户端,并添加到path 下载路径: http://www.oracle.com/tech ...
- Python3安装cx_Oracle连接oracle数据库实操总结
弄清版本,最重要!!! 首先安装配置时,必须把握一个点,就是版本一致!包括:系统版本,python版本,oracle客户端的版本,cx_Oracle的版本,然后安装配置就容易了! 如果已经安装Pyth ...
- python用cx_Oracle连接oracle
确认版本: oracle版本:64位 python版本:64位 下载cx_Oracle的whl包:64位 安装whl包:pip install wheel cd到下载路径安装cx_Oracle的whl ...
- 在PYTHON中,用cx_Oracle连接ORACLE数据库简单示例
一,在安装的时候,参数有点不一样: python setup.py build install 二,连接数据库,有两种方式,DSN和TNSNAMES方式: #dsn = orcl.makedsn(se ...
- Python 连接 Oracle数据库
1.环境设置 [root@oracle ~]# cat /etc/redhat-release CentOS release 6.9 (Final) [root@oracle ~]# python - ...
- Python 连接Oracle数据库
连接:python操作oracle数据库 python——连接Oracle数据库 python模块:cx_Oracle, DBUtil 大概步骤: 1. 下载模块 cx_Oracle (注意版本) ...
- Python + cx_Orcale 连接Oracle数据库
这是我在使用python连接Oracle数据库时遇到的问题.在此做一下总结. 1.pip install cx_Oracle 2.然后还需要在下载一个数据库客户端工具instantclient-bas ...
- 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 ...
- 【python】python连接Oracle数据库
python连接Oracle数据库 查看Oracle版本 select * from v$version 下载对应版本的InstantClient 下载网址 InstantClient 1.解压Ins ...
随机推荐
- Codeforces Round #416 (Div. 2) 本来以为这个时间是晚上的,下午就没做
A. Vladik and Courtesy time limit per test 2 seconds memory limit per test 256 megabytes input stand ...
- POJ-2078 Matrix,暴力枚举!
Matrix 题意:一个n*n的数字矩阵,每次操作可以对任意一行或者一列进行循 ...
- RDDs基本操作、RDDs特性、KeyValue对RDDs、RDD依赖
摘要:RDD是Spark中极为重要的数据抽象,这里总结RDD的概念,基本操作Transformation(转换)与Action,RDDs的特性,KeyValue对RDDs的Transformation ...
- Luogu【P2904】跨河(DP)
题目链接在这里 此题DP.用一个前缀和一样的东西,把载i个奶牛的时间求出来,然后DP代码如下: ;i<=n;++i){ f[i]=que[i]; ;j<i;++j) f[i]=min(f[ ...
- FZU 2186 小明的迷宫 【压状dp】
Problem Description 小明误入迷宫,塞翁失马焉知非福,原来在迷宫中还藏着一些财宝,小明想获得所有的财宝并离开迷宫.因为小明还是学生,还有家庭作业要做,所以他想尽快获得所有财宝并离开迷 ...
- spring中quartz的使用。【转http://www.cnblogs.com/kay/archive/2007/11/02/947372.html】
注:从spring3到spring4改变 org.springframework.scheduling.quartz.CronTriggerBean org.springframework.sched ...
- linux 查看自己所在的公网ip
curl members.3322.org/dyndns/getip 其他的方法还有: curl icanhazip.com curl ifconfig.me curl curlmyip.com cu ...
- poj1426 - Find The Multiple [bfs 记录路径]
传送门 转:http://blog.csdn.net/wangjian8006/article/details/7460523 (比较好的记录路径方案) #include<iostream> ...
- hdu4619 / 最大独立集
题意,一个矩阵,上面可以横放或者竖着放骨牌(1X2)保证横的与横的不重叠,竖的和竖的不重叠,求拿掉最小的牌,使所有的都不重叠. 分析:一看,不重叠就是没有边,拿最少,就是留最多,最大独立集啊!二分图, ...
- BZOJ——1720: [Usaco2006 Jan]Corral the Cows 奶牛围栏
http://www.lydsy.com/JudgeOnline/problem.php?id=1720 Time Limit: 5 Sec Memory Limit: 64 MBSubmit: 1 ...