Connect Python to Oracle and pythonoracle

Source: Internet
Author: User

Connect Python to Oracle and pythonoracle

Http://wenku.baidu.com/link? Url = Response

Installation list

1. Python

Configure environment variables for Python

2. setuptools

Open hosts

Run: D :\> ez_setup.py

Configure environment variables for setuptools

3. pip

Easy_install pip

4. cx_Oralce

Command line installation failed

Find the installation file on the following blog:

Http://blog.csdn.net/linghe301/article/details/8115632

After installation, run import cx_Oracle in the command line Python command line.

The following error is reported,

ImportError: DLL load failed: % 1 is not a valid Win32 application.

Because the sub-database is 64-bit and cx_Oracle is also installed 64-bit, but the Oracle client installed is 32-bit, because PLSQL Developer only has 32-bit. Therefore, the cx_Oracle is replaced with a 32-bit installation.

 

5. Install pydev in MyEclipse

Http://www.blogjava.net/caojianhua/archive/2012/07/17/383324.html

 


Several ways to connect Python to oracle

Connection = cx_Oracle.connect (tp/tp @ ocn_test) # view the tns alias command running tnsping successfully Ping Utility forLinux: Version 9.2.0.8.0-Production on 27-SEP-201110: 47: 48 Copyright (c) 1997,2006, Oracle Corporation. allrights reserved. used parameter files:/opt /...... /Sqlnet. oraUsed TNSNAMES adapter to resolve the aliasAttempting to contact (DESCRIPTION = (ADDRESS_LIST = (ADDRESS = (PROTOCOL = TCP) (HOST = 10.20.36.19) (PORT = 1520 ))) (CONNECT_DATA = (SID = ocntest) OK (10 msec) 2. user input password connection

Python connection Oracle error: DatabaseError: ORA-12514: TNS: Listeners currently cannot recognize services in the connection Descriptor

Local geological Error

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.