Connect Oracle DB from SSIS using ODBC? - oracle

I have been trying to connect to an Oracle Database using SSIS(Visual Studio) using ODBC as the connection manager.
My OS is Windows 7 (64 bit), Visual Studio 2010 (32-bit) and Oracle 11G is 64 bit.
While connecting to Oracle 11G using Visual Studio via ODBC I am greeted with the following error:
'The specified DSN has an architecture mismatch between driver and application'
This is understandable as Visual Studio is 32 bit and the server I am trying connect to is 64 bit.
Possible solutions?

Install both the 32 and 64 bit providers for oracle. This will allow you to configure the connection (in 32 bit) and run the package in 64 bit.
Also, check out attunity: https://www.microsoft.com/en-us/download/details.aspx?id=44582
This is a free oracle source and destination component from Microsoft. You'll find that it uses native oracle interfaces and runs much faster than ODBC.
m

Related

How do I do an ODBC connection to ORACLE from SSIS/ Visual studio?

Despite that OLE DB and ADO.NET are newer than ODBC potentially, I've heard that ODBC connections to Oracle are potentially faster within SSIS.
I'm trying to set up a simple ODBC connection to an Oracle DB in SSIS
The OLE DB / ADO.Net connections were easy. I entered the credentials and boom, connected.
ODBC proves very difficult. I'm running Windows 10 64 bit. Visual Studio 2015 (I believe the designer for SSIS was only meant to initially play with 32-bit ODBC connections). Oracle is version 12c.
So ... I did the convoluted Oracle driver install. Downloaded Oracle basic light express + ODBC. Put them in the same directory. Ran odbc.install.exe WITH admin privileges. Finally got the Oracle driver to show up in Microsoft ODBC (32 or 64, ended up downloading both eventually). I test the connection in Microsoft ODBC setup? Success!! NOOOOW. .. enter Visual studio. Set up connection --- test --- FAIL! Some cryptic error .... 127 ... the "oracle" in quora32.dll can't be found.
Are Microsoft Drivers for Oracle still available for download?
32-bit vs 64-bit
I think that the main cause of the problem is that Visual studio is a 32-bit application and the ODBC driver installed is 64-bit. On the other hand the operating system is 64-bit then it will work normally. Check the following links for more information:
ODBC Connection not appearing SSIS
Set up the ODBC Driver for SSIS
Attunity connectors
I really didn't tried connecting to Oracle using ODBC, but if your goal is to achieve higher performance then the fastest way to connect to Oracle from SSIS is using Attunity high speed connectors for Oracle that have been selected by Microsoft to be included with SQL Server Integration Services (SSIS).
Check the following links for more information:
Microsoft Connectors for Oracle and Teradata by Attunity for Integration Services (SSIS)
Microsoft Connectors by Attunity
Oracle provider for Oledb missing in VS 2015 Shell
SSIS not running in parallel with OraOLEDB.Oracle.1 Provider
As noted in various ways on this question, the VS IDE (and its typical testing environment) is 32-bit, even when installed/running on 64-bit Windows, or when building for use/deployment on 64-bit Windows. My employer has a knowledgebase article discussing this.
Also, SQL Server, SSIS, and VS are always OLE DB or ADO.NET clients; they don't actually speak ODBC directly. When you tell either SQL Server, SSIS, or VS to connect to an ODBC driver or ODBC DSN, they invisibly use the Microsoft OLE DB [Bridge] Provider for ODBC Drivers for that connection.
The easiest way to work around all this, given that you explicitly want to use ODBC, is to install both 32-bit and 64-bit variants of all OLE DB (including the Bridge Provider) and ODBC components (and any libraries on which they depend, such as OCI or Oracle Instant Client), and to configure a pair of ODBC System DSNs (not User DSNs, for several reasons), one each 32-bit and 64-bit, which are named and configured identically excepting only the driver library.
This strategy works whether you're using ODBC drivers from my employer (which might be the "12-15x faster" ones referenced previously? if so, it's important to note that Enterprise Edition "concurrent users" is about actively connected clients, not installed seats), from another third-party, or from Oracle themselves.

Oracle Data provider for .NET in visual studio

Newbi to oracle and its versions and .NET providers, but did some investigation.
I'm trying to add Oracle connection to the visual studio server Explorer (before setting up the Entity Framework 6 for oracle).
System preferences:
Windows 10 enterprise - 64 bit operating system
Visual Studio 2015
Oracle Data Access Components (ODAC) which includes Oracle developer Tools for Visual Studio: ODAC12C - 12.2.0.1 - it is suitable to 64 bit !
The DB is located in a remote machine and I can see the DB objects using the Oracle SQL developer. It uses the TNSNames file to locate the DBs.
when trying to "add connection" in the visual studio server explorer:
Select Data Source: Oracle DataBase
Data Provider:.NET framework data provider for Oracle.
It claims that:
"This provider is deprecated and should not be used. Instead download
Oracle Developer tools for visual studio for comprehensive integration
with Oracle database."
The problem is that the mentioned above reference links to a 32-bit Oracle Data Access Components (ODAC) bundle which includes "Oracle Developer Tools for Visual Studio". The same shXX happens when choosing .NET framework data provider for OLEDB.
Either I don't see the relevant provider in the list or there is a problem.
After inserting Server name, User name and Password in the "Add connection" dialog box, I get this error message:
"Attempt to load Oracle Client libraries threw BadImageFormatException.
This problem will occur when running 64 bit mode with the 32 bit Oracle Client components installed"
What am I doing wrong ?
Is this the way of defining connection string when I have a TNSNames file ?
Microsoft .NET Framework Data Provider for Oracle is different to Microsoft OLE DB Provider for Oracle which is different to Oracle Data Access (which can be Oracle Data Provider for .NET or Oracle Data Provider for .NET Managed Driver or Oracle Provider for OLE DB, depending on which one you installed), see How to connect to Oracle 11 database from . net
Visual Studio 2015 is 32-bit, when you like to connect to an Oracle database directly from Visual Studio Explorer then you have to download/install the 32-bit version of ODAC - and also install 32-bit Oracle Client.
In case you like to use also 64-bit Oracle Client and drivers follow this instruction: BadImageFormatException. This will occur when running in 64 bit mode with the 32 bit Oracle client components installed

Microsoft ODBC for Oracle on Windows 2008 R2 x64

I have server under Windows Server 2003 with Oracle 10 32bit. There are several ODBC data sources configured in ODBC Data Source Administrator.
Now I need to move all that system to Windows Server 2008 R2 x64.
I've installed OS, Oracle server 12c x64, Oracle client 12 x64.
Now I need to configure my ODBC data sources, but there is no Microsoft ODBC for Oracle driver.
Where can I find this driver to configure ODBC data source?
(I've tried 32bit tool from SystemWOW64, it has this driver but shows me exception "The Oracle(tm) client and networking components were not found. These components are supplied by Oracle Corporation and are part of the Oracle version 7.3 (or greater) clien costware installation." As far as I could say it looks for 32bit client, but there is no such)
"Microsoft ODBC for Oracle" does not exist for 64 bit. Microsoft provides only a 32-bit version.
You have to download and install the driver from Oracle: ODBC
Developer Center or
64-bit Oracle Data Access Components (ODAC) Downloads
The 32-bit ODBC driver (no matter if from Microsoft or from Oracle) does not work together with an 64-bit Oracle Client, the architectures have to match.

DSN name does not appear in Excel

My notebook has Windows 8 64 bit, Microsoft office 2010 32 bit and Oracle DB 11gR2 64 bit installed. I have created DSN to access oracle databases via ODBC sources 64 bit. I want to obtain data from oracle database to Microsoft Excel or Access via ODBC (in excel -> Data - From other sources - from Microsoft query). But DSN name that I created earlier do not appear. What can I do?
If the Application that wants to Access an ODBC-Datasource is 32bit, you need to use the 32bit version of the ODBC-Driver.
In your case you use a 32bit Version of Microsoft Office to Access the Datasource, so you need to use the 32bit Version of the ODBC-Driver. Configure your DSN using
C:\Windows\SysWOW64\odbcad32.exe
and they will probably show up in the 32bit Version of Office.

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.

Resources