Python connects Oracle

Source: Internet
Author: User

Import= cx_oracle.connect (' user name/password @ip/servicename'#1 parameters = Cx_oracle.connect (' username ' ' password ')    ip/servicename'#3 parameters

Open the Tnsnames.ora under the D:\app\username\product\11.2.0\client_1\NETWORK\ADMIN path

The IP here describes the Host,servicename as service_name for the following connections

(DESCRIPTION =
(Address_list =
(ADDRESS = (PROTOCOL = TCP) (HOST = 111.111.111.111) (PORT = 1521))
)
(Connect_data =
(service_name = ORCL)
)
)

At the beginning of the connection, Oracle on my machine is a 32-bit client connected to the 64-bit server side and the client is located in D:\app\username\product\11.2.0\client_1

When attempting to connect, the error will be as follows:

Cx_oracle.databaseerror:dpi-1047:64-bit Oracle Client Library cannot be loaded: "D:\app\sabre\product\11.2.0\client_1 \bin\oci.dll is not the correct architecture ". See Https://oracle.github.io/odpi/doc/installation.html#windows for help

Follow the link in the prompt to locate the Oracle 64-bit client file package, download it, put it in D:\instantclient_11_2, and then add the path to the system path and try connecting again.

Python connects Oracle

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.