How to fix SSIS (dtexec) System.InvalidOperationException: Attempt to load Oracle client libraries threw BadImageFormatException

brwillia 0 Reputation points
2023-07-10T19:52:29.5533333+00:00

We have a very old SSIS package that runs fine on Windows Server 2012 R2. We are decommissioning the Windows Server 2012 R2 vm and have a Windows Server 2016 vm.

The SSIS package accesses Oracle. I can see within the script portion of the dtsx file:

using System.Data.OracleClient;

I think this System.Data.OracleClient is deprecated. We will address that later, but for now, we are just trying to get this dtsx to run successfully with the dtexe.exe on the Windows Server 2016 vm. We installed the SQL Server 2016 SSIS portion on the Windows Server 2016 vm.

We get:
Error
Code: 0xC0047062

Description: System.InvalidOperationException: 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...
Code: 0xC004701A

On the Windows Server 2012 R2 vm and on the new Windows Server 2016 vm, the 32-bit and 64-bit "ODBC Data Source Administrator" shows more-or-less the same Drivers installed. Just the Windows Server 2016 vm one has slightly updated ones.

SQL Server Integration Services
SQL Server Integration Services
A Microsoft platform for building enterprise-level data integration and data transformations solutions.
2,705 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. ZoeHui-MSFT 41,496 Reputation points
    2023-07-11T01:51:03.41+00:00

    Hi @brwillia,

    This is caused by a mismatch between 32-bit version and 64-bit version component.

    Please try to install both the 32 and 64 bit Oracle clients.

    Regards,

    Zoe Hui


    If the answer is helpful, please click "Accept Answer" and upvote it.


  2. Yitzhak Khabinsky 26,586 Reputation points
    2023-07-12T13:17:13.3933333+00:00

    Hi @brwillia,

    I can see within the script portion of the dtsx file:

    using System.Data.OracleClient;

    It seems that your SSIS package is using a Script Task where it is accessing Oracle db. It is a reference to an assembly, and has nothing to do with Oracle ODBC drivers.

    Check it out here: https://learn.microsoft.com/en-us/dotnet/api/system.data.oracleclient?view=windowsdesktop-7.0

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.