`
songbin0201
  • 浏览: 320161 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

Oracle in Python

阅读更多
First:下载安装 cx_Oracle
http://cx-oracle.sourceforge.net/
注意对应你的oracle客户端版本和python版本

Second:拷贝文件
从{oracleInstall}/BIN目录下拷贝OCI.DLL文件到{pythonInstall}\Lib\site-packages目录下

Third:调试代码
打开python编译器,输入如下代码,测试oracle是否能正常连接
   import cx_Oracle
   db = cx_Oracle.connect('username', 'pwd', 'TNS_NAME')


如果没有“权限不足”、“无法解析指定的连接标识符” 之类的异常出现,恭喜你已经可以通过python正常连接oracle数据库了

PS:别忘了两个环境变量的配置
    ORACLE_HOME=C:\oracle\product\10.2.0\client_1
    Path=C:\oracle\product\10.2.0\client_1\bin
分享到:
评论

相关推荐

    利用python-oracledb库连接Oracledb数据库,使用示例

    python-oracledb的源码和使用示例代码, python-oracledb 1.0,适用于Python versions 3.6 through 3.10. Oracle Database; This directory contains samples for python-oracledb. 1. The schemas and SQL ...

    精通 cx_oracle-python.pdf

    python 管理数据库 oracle Mastering Oracle in Python

    Python使用cx_Oracle调用Oracle存储过程的方法示例

    本文实例讲述了Python使用cx_Oracle调用Oracle存储过程的方法。分享给大家供大家参考,具体如下: 这里主要测试在Python中通过cx_Oracle调用PL/SQL。 首先,在数据库端创建简单的存储过程。 create or replace ...

    Python导入oracle数据的方法

    本文实例讲述了Python导入oracle数据的方法。分享给大家供大家参考。具体如下: import cx_Oracle dns_tns=cx_Oracle.makedsn("192.168.0.288",1521,"skynet") print dns_tns con = cx_Oracle.connect('alibaba', '...

    oracle11g oci.dll

    此外, Oracle In-Memory Database Cache(即 IMDB Cache,又称为 TimesTen)也支持 OCI 和 Oracle Pro*C/C++ 预编译器。Oracle Instant Client 为 ISV 和客户提供了快速安装和部署 Oracle 应用程序的能力。

    windows下python连接oracle数据库

    python连接oracle数据库的方法,具体如下 1.首先安装cx_Oracle包 2.解压instantclient-basic-windows.x64-11.2.0.4.0.zip到c:\oracle 3.拷贝instantclient_11_2下所有.dll文件到c:\python34\Lib\site-packages\下...

    cx_Oracle-7.1.2-cp37-cp37m-win_amd64.zip

    使用python语言连接oracle数据库的连接工具,示例如下: import cx_Oracle connection = cx_Oracle.connect("scott", "tiger", "localhost/orcl") cursor = connection.cursor() cursor.execute(""" SELECT empno...

    Python连接Oracle之环境配置、实例代码及报错解决方法详解

    Python版本:Python 3.6.4 :: Anaconda, Inc. 2、下载网址 https://www.oracle.com/database/technologies/instant-client/downloads.html 3、解压至目录 解压后(这里放D盘) 4、配置环境变量 控制面板\系统和...

    Linux下通过python访问MySQL、Oracle、SQL Server数据库的方法

    本文档主要描述了Linux下python数据库驱动的安装和配置,用来实现在Linux平台下通过python访问MySQL、Oracle、SQL Server数据库。 其中包括以下几个软件的安装及配置: unixODBC FreeTDS pyodbc cx_Oracle 欢迎转载...

    Python for Unix and Linux System Administration

    SQLite, Oracle, Postgres, Django ORM, and SQLAlchemy, With this book, you'll learn how to package and deploy your Python applications and libraries, and write code that runs equally well on multiple ...

    Python连接Mssql基础教程之Python库pymssql

    另外除了pymssql,pyodbc还有其他几种连接SQL server的模块,感兴趣的可以在这里找到:https://wiki.python.org/moin/SQL Server 本文将详细介绍关于Python连接Mssql之Python库pymssql的相关内容,下面话不多说了,...

    Foundations for Analytics with Python O-Reilly-2016-Clinton W. Brownley

    This chapter focuses on basic Python syntax and the elements of Python that you need to know for later chapters in the book. For example, we’ll discuss basic data types such as numbers and strings ...

    oracle特有的错误:ORA-01036:非法的变量名/编号

    ORA-01036:非法的变量名/编号 oracle特有的错误

    cx_Oracle-5.1-11g.win32-py3.2.msi

    python3.2操作Oracle库的第三方库,下面是例子 import cx_Oracle db=cx_Oracle.connect('scott','tiger','localhost/MYTEST') print(db.version) cursor=db.cursor() #sql语句不能加; sql="select * from scott.emp ...

    Python监控系统信息、巡检数据库将结果写入到html,并定时发送邮件到邮箱

    Oracle中查询数据 系统信息: MemoryInfo totalMem freeMem avaMem {% for key,value in mInfo.items() %} {{ value }} {% endfor %} CPUInfo {% for key in cpuInfo.keys() %} {{ key }} {% endfor...

    orcal暴力破解

    OraclePasswords。orcal暴力破解工具。OraBrute v 1.1 --------------- orabrute <hostip> <port> <sid> ...100 millisecond wait seems to be optimal for oracle client server in close proximity.

    Python2.x利用commands模块执行Linux shell命令

    用Python写运维脚本时,经常需要执行linux shell的命令,Python中的commands模块专门用于...‘/home/oracle’ 2. commands.getstatus(‘file’) 该函数已被python丢弃,不建议使用,它返回 ls -ld file 的结果(St

    Windows平台Python连接sqlite3数据库的方法分析

    接下来说说Python连接sqlite数据库,非常简单,因为python中的sqlite模块也遵循了DB-API 2.0的规范,所以操作起来和sql server、MySQL、oracle数据库都是一样的。 一、在 Windows 上安装 SQLite: (1)请访问 ...

    DB上具有JSON功能的开发包Json-in-DB.zip

    Json-in-DB 存储库包含 Oracle Database 12.1.0.2.0 及其更高版本的 JSON 功能,且支持下载和安装。每个示例可以独立安装和演示。每个在 DB 存储库中的 JSON 的示例都有它自己的文件夹。安装和运行示例时,在 ...

    Oracle 随机数

    利用oracle的dbms_random包结合rownum来实现,示例如下,随机取499户: select * from ( select * from busi.t_ar_userinfo order by dbms_random.value) where rownum < 500; 有关dbms_random的参考文献,链接...

Global site tag (gtag.js) - Google Analytics