Anybody seen this behavior with Sql Server Reporting Services, a 64bit OS and an Oracle datasource? - oracle

I'm working on a Sql Server Reporting Services solution that queries across both a Sql Server data source and an Oracle 10g data source. My dev box is Windows 7 64bit with Sql Server 2008R2 and I'm hosting IIS7 and SSRS on that system for development; using VS.NET for designing the reports.
I have been having errors when running the report where SSRS complains about loading the 32 bit Oracle client in a 64bit process. There a number of threads out there about how to solve that. The thing is, they all come down to making sure you have the 64bit Oracle, client which I do. The weird chain of events I have goes like this:
Create initial Oracle datasource and wire up report (it works)
Edit Oracle datasource connection (it stops working with BadImageFormatException 32bit/64bit error message)
uninstall and reinstall Oracle client (it works)
Edit Oracle connection again (it stops working with BadImageFormatException 32bit/64bit error message)
So short of reinstalling the client every time I change the connection string I am at a complete loss. Has anybody seen this sort of behavior? And if so what the heck am I doing wrong?

Originally answered here: SSRS report with 32-bit Oracle Client Not working in 64-Bit Environment
This is the second time I configure a similar server, and the second time I spend hours figuring this one out. If for nobody else, I am writing this for the future me. This is for a Windows Server 2012 R2 64bit, 8GB RAM, 300+GB HDD, Intel Xeon CPU E5620 # 2.40GHz, that is running Microsoft SQL Server Reporting Services 2012 64bit and IIS 7.0 with web applications that use the Oracle Client 32bit connection System.Data.OracleClient
Install the 64bit client
Change the name of the Oracle inventory directory # "C:\Program Files\Oracle" to "C:\Program Files\Oracle64"
Restart computer and test for connection from SSRS to Oracle
Install the 32bit client and specify a different location for its home directory
Restart computer and test connection from SSRS to Oracle and from Web Applications to Oracle
I hope this helps my future self and others :)

You need to install 64 bit Oracle Client. Beware, i had bad experience on having both oracle 32 bit and 64 bit client. I ended up uninstalling 64 bit oracle client and trying to figure out installing SSRS in 32 bit mode on 64bit win7.

Related

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.

Getting BIDS 2008 R2 to connect to Oracle using MSDAORA on Windows 8

I have a new dev machine, and I need to support legacy SSIS packages. The new machine is Windows 8 64 bit with a SSD primary drive (C:) and a regular HDD for data (D:). On it, I have installed BIDS 2008 R2 (and all the tricks to get it to work with TFS2010), as well as VS2010, ODAC 32 bit and 64 bit (I think??), Oracle Client (SQLDeveloper).
I can get the following to connect just fine to an Oracle database:
VS2010 with MSDAORA
VS2010 with ODAC
VS2010 with ADO.NET
Test connection using .udl file with Oracle OLE DB Provider (MS provider does not show up as an option here)
SQLDeveloper (Oracle's Client Tool)
What I CAN'T seem to do is get BIDS 2008 R2 to connect to Oracle using ANY method (MSDAORA, ADO.NET, ODAC).
The problem seems isolated to my machine, I can otherwise open, view, validate, connect and run these packages on other machines with no issues.
I have tried the following:
Ensured any/all TNSNAMES files are correct and identical (taking working copies from other machines, and let's not forget, this works fine in VS2010)
Created ORACLE_HOME and TNS_ADMIN Environment Variables and pointed them to various directories within D:\app\username\product\11.2.0
Checked registry manually to make sure no other references to ORACLE except for the entries in HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE
Unistalled/Reinstalled SQL Server 2008 R2 components
Every "solution" offered in every thread in every search I have tried
Thrown chicken bones and offered sacrifices to pagan deities
After each attempt at a fix, I still get the following error when trying to Preview a SQL Command in the Data Flow:
An OLE DB record is available. Source: "Microsoft OLE DB Provider for Oracle" Hresult: 0x80004005 Description: "Error while trying to retrieve text for error ORA-01019"
Yes, I know I need to drop MSDAORA in favor of ODAC, and if ODAC worked in BIDS 2008 R2 I would certainly do it. However, I can't get anything to connect to Oracle there (even though, as mentioned above, it connects fine in various other tools)
I have two "client_n" directories in D:\app\username\product\11.2.0. As mentioned, I have tried pointing my environment variables to various paths inside. It seems like the correct path for ORACLE_HOME should be just D:\app\username\product\11.2.0, correct?
Has anyone had any luck getting BIDS 2008 R2 to connect to Oracle while on WINDOWS 8 with VS2010 also installed? It seems to me like it's a simple Oracle connection issue, I just don't know enough about Oracle to troubleshoot.
Any other ideas to try?
BIDS is x32 (even on an x64 machine), so you will need to install the Oracle Client x32 edition, Full Install.
We were able to get it to work, though I believe that we installed too much software. (I have not been able to test it with only the ODAC drivers.)
Install the Oracle Client 32 & 64-bit drivers.
Install the Oracle ODAC 32 & 64-bit drivers.
In BIDS use the native Oracle connection, and not the Microsoft driver.

Using Oracle DB from C#-VS2005

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.

Is an OLE DB Oracle datasource possible in VS 2005 on Windows 7 x64? (if so how?)

I'm really not sure if this is the correct forum for this, apologies if I should aim this elsewhere.
I've been given (as a very silly experiment IMO) a Windows 7 x64 machine at work. This might be fine if I didn't have to get anything done. Unfortunately, since we're running SQL Server 2005, I need BIDS 2005 in order to edit and publish the existing SSIS packages on the server. BIDS 2005 does not play amazingly well with Windows 7 x64, the very smallest of annoyances is the complete inability to compile scripts without opening them.
Anyway, I now have a need to connect to an Oracle datasource so I can export results from it, but no matter what I try, I end up with the dreaded "protocol adapter error" when I try to connect within BIDS.
I've installed the 32 bit version of the full Oracle client and I can connect via ODBC and SQL Developer, but when I try to create an OLE DB connection within BIDS (with either the microsoft or Oracle driver), all I get is the error described.
I really don't like Oracle, so I haven't used it enough to even know how to begin to troubleshoot this, although I will say that SQL*Plus has the same problem, despite being able to TNSPing the server.
Any ideas? I'm a short step away from either reinstalling windows or running a 32-bit virtual machine and doing all my development in there.
Sounds like the issue may be at the Oracle side...but if you can connect via ODBC can you try using the ADO.NET Data Source instead of the OleDb source?
Weirdly, it's working now, and I'm really not sure why. Let's chalk this one up to Oracle being broken and strange generally, although there are a few things that are worth learning from this :
BIDS needs to be restarted whenever you make changes to TNSNames.ora. It seems this is even the case when you supply the full TNS connection in the connection string.
On Windows 7, it is IMPERATIVE that you run the Oracle deinstall.bat as Administrator. If you don't you'll end up with a broken Oracle installation that is almost impossible to remove cleanly.
Despite being able to use a 64bit SSIS run-time, BIDS 2005 cannot use the 64bit Oracle drivers.
If you like having a (relatively) clean dev system, do not install the Oracle client - it's possible to install the 32 and 64 bit drivers side but uninstalling them is non-trivial and not guaranteed to work (for example, I've actually ended up with the 32bit drivers installed on my machine now, but due to previous uninstallations the ODBC manager can't see the Oracle drivers)
I think next time I'll just do my development in a disposable virtual machine.

Is ODP.NET required for Oracle 11g Client?

I may be asking the wrong question here, I'm willing to change it if so.
I have a project that is using the Microsoft.NET Oracle provider (our plan is to change to ODP but we haven't done so yet).
I am trying to get this project to build on a windows 2008 (x64) build server. It builds just fine but our unit tests fail when they hit stuff on the Oracle database.
I had initially installed the 32bit oracle 9i client which is what we currently use on our winxp dev boxes and the previous 2003 build server. But now this gets a message like: Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
We tried compiling to the x86 platform but that didn't change the error message.
I now have the 11g 64 bit client installed but I am getting a message saying System.Data.OracleClient requires Oracle client software version 8.1.7 or greater.
So what Oracle install should I be using?
Edit:
I was able to get this to work. Turned out it was the testing causing the problem, by forcing NUnit to run in 32bit mode: Link I was able to get the tests to work using the old 32 bit driver. This would be a crappy answer to the question so I am not using it but will gladly award the correct answer to anyone putting in some good info on transitioning to Oracle 64bit drivers.
When it comes to Oracle, I like to use Oracle Instant Client :
You don't have to install anything on the target machines (including dev boxes !).
You can make sure that your application will run with the specific client you picked.
You could even easily have multiple applications work with different client versions on the same computer.
As a downside, it adds a significant weight to your application (~19Mb minimum).
Check What is the minimum client footprint required to connect C# to an Oracle database? for more information. To know how to set up a Visual Studio project that will work on x86 as well as x64 machines, check my blog post Oracle Instant Client in Visual Studio.
I'm adding a new answer since as of this fall (2012) the ODP Managed Code Beta is available. See this link for more information. It is for us highly stable and we are using it in production, mainly because of these reasons:
No installation (except for entity framework where a simple registration is needed)
It is smaller than the unmanaged version, the footprint is approx 6 MB.
It is NOT "bit sensitive", ie Any CPU will finally work with ODP :)
More intuitive mapping C# types <-> Oracle types (and it solved some problems with EF and model generation from database)
Supports EZCONNECT (all versions of the unmanaged ODP did not), ie no more tnsnames.ora hassles.
But for transitioning to 64 bit, download the managed ODP driver and change the Oracle.DataAccess reference to Oracle.ManagedDataAccess and recompile :)
I think the message "System.Data.OracleClient requires Oracle client software version 8.1.7 or greater" it's similar to "Oracle client not installed, installed but not found or installed but it's needed 8.1.7 or greater".
Check on regedit if the values are right under the key:
HKEY_LOCAL_MACHINE\SOFTWARE\ORACLE\KEY_OraOdac11g_home1
Where OraOdac11g_home1 depends on the Oracle Home name for your installation.
Also, try to connect through Visual Studio to see if its possible.
I have had an issue which could relate to what you are seeing.
I initially had the just the Oracle 10g client installed on my machine and the .Net Oracle.DataAccess component version number was 10.2.0.100 - this was for .Net runtime v1.0.3705
I installed ODP.Net and the Oracle.DataAccess component version is now v2.102.2.20 and runs on .Net runtime v2.0.50727 - I cant find the reference as to why Oracle did this - it was something to do with bringing version numbers in line with the runtime version
It took me a day to work this out. We dont use the 11g client yet and I havent used the 8i client for ages so I dont know what the version numbers would be for those clients, but I'd check it if I were you what.
In short, Oracle back-tracked the component version numbers which could be making your 11g component appear out-of-date as opposed to Oracle 8i components
I have found many times that the error "requires Oracle client software version 8.1.7 or greater" is a notoriously misleading error. From distant memory I seem to remember that this usually indicates a file IO permissions problem. I think it may be that the ASP.NET worker process (or whichever identity an application is running under) requires some sort of read or write permission to a folder in the oracle client folder hierarchy...
This can be a cause of multiple oracle homes in the environment. Remove the older version oracle home in your build system. try generating the build again with the single home. There are some issues with 9i version ODP.NET and 10G/11G connectivity

Resources