Using Oracle DB from C#-VS2005 - oracle

Oracle installed on the server is 10.2.0.3 Enterprise Edition 64bit (10g).
ODAC is showing version as 10.2.0.2.20 is on a Windows 2008 x64 machine.
Error I run into when I run my app in my test environment in above machine is
The type initializer for 'Oracle.DataAccess.Client.OracleConnection' threw an exception.
I tried using .Net Oracle namespace and I get this using a version from
C:\Windows\Microsoft.NET\Framework64\v2.0.50727
Error:
Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
Anyone run into such an issue?
Also what is the right Oracle Client/ODAC to use on Windows 2008 x64 machine? Anyonen have a link?

You seem to have installed the 32 bits Oracle client, or you must have a 32 dll masking your 64bits client. You need to install the 64bits client so that 64 bits dll can be accessed by your app. Look for an oci*.dll in your path.
Also look into the registry under hklm\software\oracle to see how many 'homes' you have.
Finally if you have toad on that client look at the home selector in the connection dialog box. It will show incomplete or inoperative homes in red.

Related

Create ODBC Connection for Oracle from Windows 10 Pro 64 Bit PC

When I try to Create ODBC Connection for Oracle from my Windows 10 Pro 64 Bit PC , it show error 'Oracle client and network component not found'.
error screenshot
Below is the Oracle Documentation for this error:
*This error causes confusion when an Oracle client has been installed. On 32-bit Windows it is enough to install the Oracle client to resolve the error. However on 64-bit Windows you must first check if the process that throws the error is 32-bit or 64-bit, then install the 32-bit or 64-bit client accordingly. I.E. If you are using a 32-bit application like Excel or Access and you have installed the 64-bit client then you will get this error.
This error will also be thrown if you are using a 64-bit application and have the 32-bit client installed.
Another scenario that can throw this error is if you are using Business Intelligence Development Studio (BIDS) with SQL Server and SQL Server Integration Services (SSIS). Some parts of these products are 32-bit and some are 64-bit, and for all these to work together you will need to install BOTH the 32-bit AND the 64-bit Oracle clients.
To check if a process is 32-bit or 64-bit, open Task Manager via either Ctrl-Alt-Del or right-clicking on the task bar, then locate the process name in the Processes tab. If there is a *32 after the process name then the process is 32-bit and will need the 32-bit Oracle client. If *32 does not appear then the process is 64-bit and will need the 64-bit Oracle client. (NB: This is only valid for 64-bit Windows. On 32-bit Windows all processes are 32-bit and 32 will not be displayed in Task Manager.)

Oracle connections broken in SSIS after uninstalling 32bit version of oracle client

I get the following error message when I try to test my connections:
Test connection failed because of an error in initializing provider. The 'OraOLEDB.Oracle.1' provider is not registered on the local machine
I originally had 32 bit and 64 bit version of Oracle 12 client installed on my work machine. I uninstalled the 32bit version, because it was causing some conflicts with another application, but now after uninstalling I can no longer use my oracle connections in SSIS.
I'm using Visual Studio 2017 - I am pretty sure I installed 64bit version of SSDT, but it looks like they install under the 86x programs folder. I can still connect via TOAD, so it looks to be an issue of SSIS not pointing to the 64bit installation, I think. Can I manually set SSIS to point to the 64bit version, or do I need to reinstall 32bit?
TSN_Admin is set to the oracle12c_64 tsnname.ora file. I have also tried using the regsvr32.exe on oraoledb12.dll file, but I get an error message, even after running command prompt as admin:
The Module "OraOLEDB.dll" was loaded by the call to DllRegisterServer failed with error code 0x80070005.
I can reinstall the the 32bit version, but I need to wait for my company's IT department to approve the request first. It could be days before I get a response.
Update 1 - Visual Studio 64-bit
After searching it looks like there is not Visual Studio 64-bit version:
Visual Studio 64 bit?
Initial Answer
I don't know if there is an official documentation for this, but based on my own experience you need to instal oracle client 32-bit on the developpement machine, because SQL Server Data Tools for Visual studio is a 32-bit application and it will not work will work with oracle client 64-bit.
But you can execute .dtsx package without any issue if you are working with oracle 64-bit client, you need to use the appropriate DtExec path:
32-bit
C:\Program Files (x86)\Microsoft SQL Server\100\DTS\Binn\DtExec.exe
64-bit
C:\Program Files\Microsoft SQL Server\100\DTS\Binn\DtExec.exe
While searching, i found many other links that share the same opinion:
Oracle Install for SSIS connectivity (and drivers 32 64 bit)
Oracle Client Provider for OLE DB in SSIS not working
Connecting to Oracle 11g on 64-bit (x64) machine SSIS 2012

-2147467259/Oracle client and networking components were not found

i have used vb6 application with oracle client 11. but at the run exe, i got the below error:
-2147467259/Oracle client and networking components were not found. These components are supplied by Oracle Corporation and are part of
the Oracle Version 7.3.3 or later client software installation.
Provider is unable to function until these components are installed.
Application platform: VB6
Application Type: exe
Window: window 10
Oracle Client version: 11
This is a duplicate question and the cause could be a number of different issues. This is likely due to the wrong client version being installed on your machine, and/or it is related to a known issue involving a security update for specific versions of windows. Please see the following Questions on Stack Overflow.
VB6 application oracle 12 64bit connection
Error ORA-03106 When using VB6 to access Oracle database in Windows 7 64bit
Oracle Client and networking components were not found - Excel VBA
Connection to Oracle through VBA no longer working
Here is the Mircosoft support article on the patch issue: https://support.microsoft.com/en-us/help/3126587/ms16-014-description-of-the-security-update-for-windows-vista-windows
Most likely you installed the 64-bit version of Oracle Client 11. VB6 binaries are always 32-but, thus you must install the 32-bit version of Oracle Client.
In case you need both, 32 and 64 bit versions one one machine follow this instruction: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed
According to your error messages you use the drivers from Microsoft. These drivers are deprecated for ages, you should prefer the drivers from Oracle.

Oraclm32.dll missing error when I try to run my application

I am currently working in Windows 7 32 bit system and my application has to run in a Windows 8 64-bit system which is the server. If sever side Oracle 64 is installed whether can I able to run my application there?
If I try to run I am getting error as oraclm32.dll is missing.
Can anyone help me is resolving the issue?
This is not a Oracle server prloblem, but client.
You can provide some more details about the architecture of your application.
Your application is a 32bit exe, so loads the oracle client 32bit.
32bit oracle client can connect to 64bit oracle server, no problem.
Installation of oracle server, includes oracle client with same architecture (in your case 64bit), but manually Oracle client can be installed twice, 32bit and 64bit on the same machine.
Take a look on Oracle instant client, can be a good choice for installing Oralce client on a server environment.
http://www.oracle.com/technetwork/database/features/instant-client/index-100365.html
Hope it helps.

Installing Oracle 10 ODP.NET on Microsoft Windows 2008 Server 64bit

I've tried to install "Oracle10g Release 2 ODAC (64-bit) 10.2.0.3 for Windows x64" from:
http://www.oracle.com/technology/software/tech/windows/odpnet/64-bit/index.html
on Windows 2008 server 64bit, but it crushes right after i run the setup.exe with the following error:
Problem signature: Problem Event
Name: APPCRASH Application
Name: javaw.exe Application
Version: 5.0.40.5 Application
Timestamp: 42a019e4 Fault Module
Name: StackHash_5c81 Fault Module
Version: 6.0.6001.18000 Fault Module
Timestamp: 4791adec Exception
Code: c0000374 Exception
Offset: 00000000000a6e97 OS
Version: 6.0.6001.2.1.0.272.7 Locale
ID: 1037 Additional Information
1: 5c81 Additional Information
2: fa1981fc0da3377cbbec45e762388188
Additional Information 3: 7698
Additional Information
4: 7defb6f15001721d919a359fb7888c17
Read our privacy statement:
http://go.microsoft.com/fwlink/?linkid=50163&clcid=0x0409
can anyone direct me to a version that i can install the latesr version of ODP.NET for Windows 2008 server 64bit?
Best regards,
Guy Bertental
It's a really tricky. Before installing ODP.NET you need to already have working connection setup to oracle database. That means:
Step 1:
Oracle install client (never succeeded with that, not recommended) or Oracle client (succeeded on Win7 ultimate 64bit, file win64_11gR1_client.zip, installed with "Runtime" option selected). After client install make sure you can connect. From command line try "tnsping yourtnanamesentry" to check if tnsnames is ok, and after that "sqlplus username/pwd#yourtnsnamesentry" to check if you know valid user and password and really can connect. Memorize or write down oracle home name and path you choosed during install.
Step 2:
Install ODP.NET (I did with file ODAC1110720.zip). Use exactly the same oracle home name, but different path during installation.
Step 3: try connecting with visual studio. For "server name" I used this: "oraclexe:1521/xe". That means I have machine called "oraclexe" which has oracle listener on port 1521, and database with instance name "xe". It's so-called "EZCONNECT" name.
I'm not sure if Step 1 is really needed or not, because maybe step3 really uses just oracle instant client.
I know, it is real pain, but this works. It took me 2 days to connect to oracle, and I had to install almost 1GB of downloaded oracle software. They could and should make that much, much, much, much easier. Like one-click install that just works. This is shame how complicated client install is.
Donwload and install Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (32-bit) on your development computer.
Delete former references to Oracle.DataAccess on your project.
Add the new reference pointing to this new version.
In Visual Studio, after adding the reference select it, then choose properties to check the setting. Set “Specific Version” true , then check that “Copy Local” is false.
Build your solution using ANY CPU target.
Next, prepare your server. Install Oracle Database 11g Release 2 Client (11.2.0.1.0) for Microsoft Windows (x64) . When installing, select the RUNTIME OPTION.
Finally, deploy your solution to your server, as you always use to do. This time it should work.
The trick is to have the same ODAC version (11.2.0.1.0) on both the development and deployment enviroments. This ODAC contains the Oracle.DataAcces.Client which you should reference on your code to access classes like OracleConnection, OracleDataReader, etc.
I had problems because I had developed using ODAC 11.2.0.1.2 (32 bits, latest at this time) but there's no x64 version for this ODAC.
So, always use the latest stable ODAC version which has 32 bits and 64 bits version if you are going to develop on 32 bits and deploy on 64 bits.
Hi Ran into your problem, solution is get a copy of 10204_vista_w2k8_x64_production_client.zip (http://www.oracle.com/technetwork/database/10204-winx64-vista-win2k8-082253.html) run this & it will install the client.
Unpack ODAC10203x64.zip then go to All Programs->OracleHome->Oracle Installation Products & run the Universal Installer. When the installer runs at the Specify Source Location browse to the Stage directory created when you unpacked ODAC10203x64.zip then install as normal.
There is a ODAC112012.zip but this will not talk to Oracle 9 dB's so the above will resolve talking to legacy dB's.
Guy- have a look at this, it may help. Getting Oracle client working is a pain at the best of times, x64 must make it harder.
I had unexpected crashes in my application using Instant Client 10.2.0.3 on Windows Server 2008 x64. After reading a few posts about the lack of support for this platform, I upgraded the client to 11.1.0.7 and it works like a charm !
So I would be surprised if ODP .NET 10.2.0.3 would be stable on Windows Server 2008 x64, if you ever managed to install it. IMHO, your options are :
use another provider (Microsoft+client v11.1, or DataDirect...).
go with the 11.1.0.7 beta version if you dare...

Resources