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

Source: Internet
Author: User

1 company Computer is Win7 64-bit flagship version, just come with the new computer, 4G+I5 This configuration does not install 64 bit that is wasted. Who knows when everything is finished, open the project and don't even have Oracle data ...

The first is the PL/SQL connection, I installed an Oracle 11g R2 64-bit locally. The Oracle server should be installed without the 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. And that way, your local IIS will have one more project in IIS when you build every project that accesses Oracle data, and it will often report strange errors when it's unstable. At last, I was going to put back the 32-bit system, and then I went on the internet to think about it.
Finally I found that is not the lightweight bag! Finally, the 32-bit Oracle Client installation package is executed with the administrator installed and selected at the time of installation. And before I encountered an ASP. NET connection is not Oracle, is the Oracle installation folder permissions problem, so I also netservices the folder Oracle is located in the user Full Control permissions. Restart again, ok! Fix, program incredibly able to connect on .... In fact, I do not know where the problem is, in the end is the lightweight package can not do it! Or is that permission problem ... Anyway, that's good. Make a note of this

2013-07-07 Note: Today is still the same problem, after another experiment, proved that the lightweight client package does not work, it must be the installation version of the installed version of the directory than the light-weight package after the decompression of the directory in more than a lot of files, thus, The Oci.dll file in the lightweight package solves the problem of PL/SQL with 64-bit Oracle, but the C # program to 64-bit Oracle, or the installation version of the client, you can not install the Administrator option, the default client option is more than 100 trillion.

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

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.