Python Operations Oracle Database environment configuration

Source: Internet
Author: User

1. Download and install the Cx_oracle installation package

Python Operations Oracle database, the first need to install the Cx_oracle package, as follows:
http://cx-oracle.sourceforge.net/
Http://sourceforge.net/projects/cx-oracle/files/5.1.2/

The system uses the CENTOS5.X series operating system, Python version is 2.4, so download support python2.4 version of the installation package.

2. Download the Oracle client, which is the official Oracle website.

Download the corresponding Oracle version of the installation package for the Linux x64 version.
oracle-instantclient-basic-10.2.0.5-1.x86_64.rpm

650) this.width=650; "style=" border-bottom:0px;border-left:0px;border-top:0px;border-right:0px; "title=" image " Border= "0" alt= "image" Src= "Http://img1.51cto.com/attachment/201407/9/703525_1404917435oqkv.png" height= "214"/ >

3. Configuring System Environment variables
# vi. Bash_profile Export ld_library_path=${ld_library_path}:/usr/lib/oracle/10.2.0.5/client64/lib # source. bash_ Profile
650) this.width=650; "style=" border-bottom:0px;border-left:0px;border-top:0px;border-right:0px; "title=" image " Border= "0" alt= "image" Src= "Http://img1.51cto.com/attachment/201407/9/703525_1404917438S1UV.png" height= "219"/ > 4. Test python Connect Oracle

#!/usr/bin/python
Import Cx_oracle
conn = Cx_oracle.connect (' System/[email protected]:1521/orcl ')
Print Conn.version
cursor = Conn.cursor ()
Conn.close ()

The results of the implementation are as follows:

650) this.width=650; "style=" border-bottom:0px;border-left:0px;border-top:0px;border-right:0px; "title=" image " Border= "0" alt= "image" Src= "Http://img1.51cto.com/attachment/201407/9/703525_1404917438MNYm.png" height= "+"/>

This article is from the "Koumm Linux Technology blog" blog, make sure to keep this source http://koumm.blog.51cto.com/703525/1436501

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.