BadImageFormatException is raised when attempting to load the Oracle client library. Issue record

Source: Internet
Author: User

The computer is Win8 64-bit, installed Oracle 11g R2 64-bit, who knows everything is finished, open the project but not even the Oracle data ...
The first is the PL/SQL connection, installed Oracle server, should not be installed client, PL/SQL should be able to connect, should be the Oracle Server version with the client's management tools and features. But PL/SQL has always reported a mistake! Probably means that can not find 32 bits of the Oci.dll file, such as errors, on-line search, said PL/SQL installed on 64-bit systems, to even 64-bit database, but also to install a 32-bit client. And I do not want to install a client, it feels too big, and again installed Oracle database, should not be installed client. Helpless had to under a intantclient (Lightweight client package). Here's the difference between this intantclient (lightweight client package) and the traditional Oracle client:

INSTANCT client is divided into several packages, of which basic is only the OCI library file
Other common packages, such as SQLPLUS,JDBC, are running on the basic package.
and
Oracle client includes not only instant client, but also many tools.

Starting with 10G, Oracle provides a lighter-weight customer package called Instant client. Once you've installed it, there's no need to install a huge Oracle client.
This way, as long as the client download instant clients, directly decompression, set path is OK.
The settings are as follows:
1. Download 32-bit Oracle Instantclient
2. Extract Oracle Instantclient to a directory
3, open PL/SQL, in the perference set OCI Library and Oracle_home, examples are as follows:
OCI Library=d:\instantclient_11_2\oci.dll (The OCI.DLL file of the extracted directory just instantclient)
Oracle_home=d:\instantclient_11_2 (just Instantclient's extract directory)
4. Set Environment variables (modify Nls_lang and tns_admin environment variables)
For Nls_lang environment variables, it is best to set to the same as the database side, first query the character set information from the database side:
Sql> Select Userenv (' language ') Nls_lang from dual;
Nls_lang
----------------------------------------------------
American_america. Zhs16gbk

Right-click My Computer-Properties-advanced-environment variables-system environment variables:
1> Click "New", the variable name is set to "Tns_admin", the variable value is set to "D:\app\Administrator\product\11.2.0\dbhome_1\NETWORK\ADMIN", click "OK"; (Directory of 64-bit Oracle Tnsname.ora files)
2> Click "New" and the variable name is set to "Nls_lang" and the variable value is set to "American_america.   ZHS16GBK ", click" OK "; (Database field set)
Finally click "OK" to exit.

At this point, re-landing plsql can be used

Good. PL/SQL is possible to log in, but we do not even have an ASP. To Connection.Open (), it says: "BadImageFormatException is raised when attempting to load the Oracle client library. This problem occurs if you are running in 64-bit mode with the 32-bit Oracle client component installed. “。 This probably means that my ASP is not supposed to use 32 of the client to access the 64-bit database, I understand. But I installed 64 of Oracle is not quite a 64-bit client installed? The lightweight 32-bit client is just convenient for PL/SQL to access the ORALCE database. This question gives a lot of answers online. Mostly, the target platform in the Build option in the properties of the project is changed to x86. Consciousness is to run the project as a 32-bit. Every project has been changed, or it doesn't work. Online also said that the site project properties in the Web item in the server changed to IIS does not use the VS comes with the web deleloper ment service, should be a process for its webDe.webServer.exe is a 32-bit process, anyway said a lot. This method is still possible. When you're done, the project can actually run and access the ORACLE64 bit database. But personally I always find this method very troublesome. Finally run directly with the IIS configuration, because vs runs the 32-bit best-fit 32-bit client should be fine.

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.