Using Python to connect Oracle cx_oracle.databaseerror:dpi-1047:64-bit Oracle Client Library cannot be loaded solution under Linux

Source: Internet
Author: User

Using Python to run database scripts on Linux: cx_oracle.databaseerror:dpi-1047:64-bit Oracle Client Library cannot be loaded solution

The cause of this problem is that the Python2.7 of this machine is 64 bits, and the database uses 32-bit instantclient-basic, so we have to update the Instantclient-basic version to 64-bit

The following is according to the official website document operation, self-test no problem.

Download Instantclient-basic RPM package or zip package, 64-bit or 32-bit, download here.

The following are the installation methods for RPM packages and zip packages, both of which can be

Zip Installation method

1. Unzip the ZIP package and place it in the new directory

# mkdir-p/opt/oracle# cd/opt/oracle# Unzip Instantclient-basic-linux.x64-12.2.0.1.0.zip

2. Install using the root userlibaio 包(主:在一些发行版中这个包称为libaio1)

# sudo yum install Libaio

3. If no other Oracle software on the server is exposed to the image, you can permanently add the client to the run-time link path, such as using sudo or as the root user

# sudo sh-c "echo/opt/oracle/instantclient_12_2 >/etc/ld.so.conf.d/oracle-instantclient.conf" # sudo ldconfig

or set the environment variable LD_LIBRARY_PATH to the appropriate directory for the Instantclient version

# Export Ld_library_path=/usr/lib/oracle/12.2/client64/lib: $LD _library_path

4. Creating an Oracle configuration directory for timely client-side applications

# mkdir-p/opt/oracle/instantclient_12_2/network/admin

 

RPM Installation Method

1. Install the downloaded RPM package with the root user and the Yum installation will automatically install the required dependency packages, such as Libaio

Oracle-instantclient12.  2-basic-12.2.  0.1.  0-1.  x86_64.  RPM                

3. If no other Oracle software on the server is exposed to the image, you can permanently add the client to the run-time link path, such as using sudo or as the root user

-"Echo/usr/lib/oracle/12.2/client64/lib >/etc/ld.so.conf.d/oracle-instantclient.conf"
# sudo ldconfig

or set the environment variable LD_LIBRARY_PATH to the appropriate directory for the Instantclient version

# Export Ld_library_path=/usr/lib/oracle/12.2/client64/lib: $LD _library_path

4. Creating an Oracle configuration directory for timely client-side applications

-/usr/lib/Oracle/12.2/client64/lib/network /admin               

Using Python to connect Oracle cx_oracle.databaseerror:dpi-1047:64-bit Oracle Client Library cannot be loaded solution under Linux

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.