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

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.

Related

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.

Oracle Data Access Components and Visual Studio connection problems

I've created an empty console application in Visual Studio 2010 and I'm attempting to add an Oracle (10g XE ) Data Connection via the Server Explorer. I'm using Oracle ODP .NET as the connector and I get the following error:
ORA-12560: TNS: Protocol Adapter Error
I can access Oracle without issue via the web interface or a console, but continually get this generic connection error in VS. I'm using the default installation of Oracle XE and running it locally.
Any suggestion on how to get this set up correctly ? Every tutorial I find works on the understanding that this connection succeeds. As such I'm struggling to find where to begin to troubleshoot. I'm comfortable with VS2010, but new to the way Oracle does things with their DB.
EDIT 1
While troubleshooting I've found this only happens with the Oracle Data Provider for .NET. Using the .NET Framework Data Provider for Oracle I am able to successfully connect.
EDIT 2
I cleaned up everything and installed 11g XE and the ODAC tools again and continue to get the same message. I realize the error is somewhat generic, I'd be happy to post more information if anyone thinks it helpful. The database is run locally, I can't imagine what kind of 'configuration' an express database would even need...
EDIT 3
The ODAC tools appear to install a 'production' version of Oracle 11 instead of the BETA version that I installed first. Almost appears as if the tool is installing another database ? I also appear to have two ORACLE_BASE locations and two TNSNAMES in what appear to be very similar folder hierarchies. Perhaps a more straightforward tutorial is the answer, Oracle's isn't very descriptive.
Oracle 10g XE seemed to be the problem. A full install of 11g (Full, not Express) took care of the problem entirely.
From here:
Possible fixes for the TNS-12560
include:
Get the latest patches for the SQL*Net client software.
Check your $ORACLE_HOME and $Path variables.
Check File permissions on the PC client.
Ensure that TNS_ADMIN is set correctly.
Check for firewall issues.
Check that the Windows database service is started. Verify teh
ORACLE_SID parameter is set correctly
in the registry.
Wow. I finally got this syntax to work.
I'm a Sql Server guy. I used Oracle back in the da day.
But I'm trying to do some Entity Framework and I said "You're not going to bed until you get Visual Studio 2012 and a edmx file to talk to Oracle.
Geeze.
Here is what I came up with:
Data Source:
Oracle Database (Oracle ODP.NET)
Data Source Name:
localhost:1521/orcl
User Name:
SYSTEM
change the default data source name to localhost.

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

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.

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

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