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