Monday, August 8, 2011

Connecting Informix databases through SSIS

I was quite confused to find a way to connect Informix database through SSIS in Windows x64 environment few days back. I went through lot more articles on the internet, but couldn't be able to find a proper direction. But the experience I have gathered lead me to achieve the connection sucessfully and it's drive me to write an article on how to create connection between Informix through SSIS.

First download the latest version of Informix Client Software Development Kit (32bit) from IBM's website. It's a freeware but you have to register on the IBM's website to download the product. Don't go for the 64bit versions since BIDS is still a 32bit application, your 64bit providers will not be shown on the providers list.

You can download the latest version of client SDK from here.

The next step is to add a path to "C:\Windows\SysWOW64" to the begining of the path environmental variable before installing the client SDK. Otherwise you will promt an error message saying add a prefix to path variable. Then install the product including IBM data server driver package.


After intalling the client SDK, use Setnet32 tool to configure a default Informix server. You can find Setnet32 application under "All programs>IBM Informix Client SDK".


Fill Server information and Host information with correct details to your Informix server. You will find the INFORMIXDIR and INFORMIXSERVER environmental variables are filled with values regarding to default server. You don't need to create those environmental variables manually on windows environmental variables.

Then add a new entry to your servises file. Service file can be found in "C:\Windows\System32\drivers\etc".


The format of the service file is clearly mentioned to the begining of the file. In my case the first entry is my service name then port number and protocol.

After editting the service file, you can create a new Open Data Base Connection (ODBC). Don't use Data Source Administrator tool in "Program Files>Administrative Tools" insted use "C:\Windows\SysWOW64\odbcad.exe" to add and configure new data source.

Select IBM INFORMIX ODBC DRIVER and click finish. Then configurations window will pop up. Give any data source name and fill appropriate connection details. Click on apply and test connection.



Use ConnectTest Demo tool to test connection and view table data.


Now you have allmost configured your environment to connect Informix. Open BIDS and create a new SSIS project. Go to add new data source, you will find "IBM OLE DB Provider for Informix" is listed under OLE DB providers. Create new connection to the Informix server and have some fun with Data.


The server name should be given in the format of database@servername.


Set Run64BitRuntime into false under project properties (Project>Properties>Debugging).

Finally I would like invite you to read my new and more interesting article on How to use Forex Trading as Part Time Earning Method. It would be more beneficial and interesting thing for you.

31 comments:

  1. Hi,
    I have a requirement like, I need to load data from SQL Server to Informix.
    I am very much new to informix. I have downloaded client SDK and installed.

    Now I need to load data from OLEDB data source to informix.
    How can I acheieve this.

    Thanks and regards,
    Dhinakaran

    ReplyDelete
  2. Total and unreserved thanks for this fantastic article.

    This has really helped me out, given the complete load of tosh that is the IBM web site that offers loads of help that is anything but helpful and basically just led me down the wrong route and took days to understand.

    NOTE TO ALL SSIS DEVELOPERS: If you have downloaded ODBC drivers elsewhere and now have a listed 32 bit driver that should work but doesn't or one that provides the server or file name box but has the authentication boxes disabled (greyed out), then follow this simple article exactly and you will get everything working.

    Previously I could get a connection but only through ADO.NET and could only use this to connect to tables or queries without parameters. Now that I have installed the correct driver I have an OLD DB connection with a paramterised query and can therefore continue with my ETL for data warehouse developement.

    I shall link my own blog to this. Please keep the post forever to help others and thanks for your work and for sharing.

    David Bridge
    David Bridge Technology Limited
    www.davidbridgetechnology.com
    http://davidbridge.wordpress.com

    ReplyDelete
    Replies
    1. Hi,

      I get error on ConnectTest Demo with error message "Test connection failed because of an error in initializing provider. EIX000: (-23197) Database locale information mismatch". Do you know what did I do wrong?

      Thanks,

      Mai

      Delete
    2. You probably haven't done anything wrong, but I found there is another step not mentioned here I had to take.

      In your DSN, uncheck and recheck the "use server database locale" box. For me, this changed the Db_locale value to en_US.57372. I altered Cliente_local to match.

      I then went into SetNet again and set both Db_locale and Client_locale to en_US.57372 on the Environment tab.

      This allowed me to get results in both ConnectTest Demo and SSIS (though in SSIS I am not following the directions here, I created an ADO.Net ODBC data provider rather than the OLE data provider described here)

      Delete
    3. Thank-you! Could not work out why setting locale to be same between db and client in ODBC connection & still couldn't get connecttest to work, this solved it!

      Delete
    4. can you help me how to fix this ?

      Delete
  3. The next step is to add a path to "C:\Windows\SysWOW64" to the begining of the path environmental variable before installing the client SDK. Otherwise you will promt an error message saying add a prefix to path variable. Then install the product including IBM data server driver package.

    Can you explain it in detail
    Thanks

    ReplyDelete
    Replies
    1. You have to update your "path" environmental variable.

      Delete
  4. Hi,

    I've gotten most everything to work but when I try to create an ODBC connection I get an error message of the following:

    "Test connection was NOT successful.[Informix][Informix ODBC Driver][Informix]INFORMIXSERVER does not match either DBSERVERNAME or DBSERVERALIASES."

    I'm sure there must be a configuration step that I missed. It sounds like the DBSERVERNAME can be set in the 'ONCONFIG' file but I can't seem to locate one anywhere on my computer. thanks in advance...

    -Derek

    ReplyDelete
  5. Thanks for sharing this information. It is Fantastic!

    ReplyDelete
  6. I am so close yet so far in getting this to work for me. I have installed the 32bit driver, configured setnet, configured the dsn, passed the dsn test connection, was able to get data from ConnectTest Demo. However, every time I add an OLE DB Connection, it gives me a message of "Test connection failed because of an error in initializing provider. EIX000: (-23197) Database locale information mismatch". Is there another place to set the DB_LOCALE and CLIENT_LOCALE other than in Setnet? Thanks for any hints!

    ReplyDelete
  7. hi, please , help how i do that for reporting services , i have the same problem

    help me please :(

    ReplyDelete
  8. I am able to get all the way without error until I go to create the IBM for Infomix OLE DB Provider -- I get an error saying "Test connection failed because of an error initializing provider. No error message available, result code: DB_E_ERRORSCOCCURED(0x80040E21). Please help. Thanks in advance!!!

    ReplyDelete
  9. I am having the same issue as the post above, does anyone have a solution?

    Thanks

    ReplyDelete
    Replies
    1. Did you set up the services file? The port number is not the same for everyone.

      Delete
  10. Thank you! great information.

    ReplyDelete
  11. Thanks for sharing your knowledge. It's a great help!

    ReplyDelete
  12. you made my day :-)

    ReplyDelete
  13. Hi, when I have my package created and opened in BIDS, I can run the job and it will export data out of Informix and into my staging environment and processes from there fine. However, when I take the same job and try to run it via the SQL Agent on a scheduled job, it fails with the following error:


    Started: 2:55:08 PM
    Error: 2014-07-29 14:55:09.20
    Code: 0xC0047062
    Source: Data Flow Task DataReader Source [31]
    Description: System.Data.Odbc.OdbcException: ERROR [IM002] [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified
    at System.Data.Odbc.OdbcConnection.HandleError(OdbcHandle hrHandle, RetCode retcode)
    at System.Data.Odbc.OdbcConnectionHandle..ctor(OdbcConnection connection, OdbcConnectionString constr, OdbcEnvironmentHandle environmentHandle)
    at System.Data.Odbc.OdbcConnectionOpen..ctor(OdbcConnection outerConnection, OdbcConnectionString connectionOptions)
    at System.Data.Odbc.OdbcConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningObject)
    at System.Data.ProviderBase.DbConnectionFactory.CreateNonPooledConnection(DbConnection owningConnection, DbConnectionPoolGroup poolGroup)
    at System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection)
    at System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory)
    at System.Data.Odbc.OdbcConnection.Open()
    at Microsoft.SqlServer.Dts.Runtime.ManagedHelper.GetManagedConnection(String assemblyQualifiedName, String connStr, Object transaction)
    at Microsoft.SqlServer.Dts.Runtime.Wrapper.IDTSConnectionManager90.AcquireConnection(Object pTransaction)
    at Microsoft.SqlServer.Dts.Pipeline.DataReaderSourceAdapter.AcquireConnections(Object transaction)
    at Microsoft.SqlServer.Dts.Pipeline.ManagedComponentHost.HostAcquireConnections(IDTSManagedComponentWrapper90 wrapper, Object transaction)
    End Error
    Error: 2014-07-29 14:55:09.20
    Code: 0xC0047017
    Source: Data Flow Task DTS.Pipeline
    Description: component "DataReader Source" (31) failed validation and returned error code 0x80131937.
    End Error
    Error: 2014-07-29 14:55:09.20
    Code: 0xC004700C
    Source: Data Flow Task DTS.Pipeline
    Description: One or more component failed validation.
    End Error
    Error: 2014-07-29 14:55:09.20
    Code: 0xC0024107
    Source: Data Flow Task
    Description: There were errors during task validation.
    End Error
    DTExec: The package execution returned DTSER_FAILURE (1).
    Started: 2:55:08 PM
    Finished: 2:55:09 PM
    Elapsed: 0.5 seconds

    If I check it to be run as Use 32 bit runtime, it fails saying Option "/X86" is not valid.


    Any thoughts?


    Thank you,

    ReplyDelete
  14. Anybody get this to work on Windows Server 2012? I cannot. I can get this as well as OLEDB to work on Windows Server 2008 R2 but not Windows Server 2012

    ReplyDelete
  15. HI Can someone pls let me know how to pass a variable value to Informix DB using MSSql .
    Thanks

    ReplyDelete
  16. Thank you for your great blog post, finally got data to pull from SSIS. I used ODBC connection vs OLE/DB. Don't forget this: Set Run64BitRuntime into false under project properties (Project>Properties>Debugging).

    ReplyDelete
    Replies
    1. How you fixed this error ""Test connection failed because of an error in initializing provider. EIX000: (-23197) Database locale information mismatch""

      Delete
  17. This comment has been removed by the author.

    ReplyDelete
  18. Hi. Can anybody help me in writing the package for migration of the complete datadase with all the tables, not just a single one. Please give any idea. For each loop is not helping me in setting SMO enumerator. Could anybody let me know the steps to follow.

    ReplyDelete
  19. This comment has been removed by a blog administrator.

    ReplyDelete
  20. Hi Dinesh,

    I have read your great article and helping me in the direction where I am going which is to import Informix tables to SQL server environment.
    I am about to set a linked server up and until then trying to import data by using flat files but having encountered some problems with.
    Keep up the great work!
    Cheers,

    Sanjeewa

    ReplyDelete
  21. All thanks to Mr Anderson for helping with my profits and making my fifth withdrawal possible. I'm here to share an amazing life changing opportunity with you. its called Bitcoin / Forex trading options. it is a highly lucrative business which can earn you as much as $2,570 in a week from an initial investment of just $200. I am living proof of this great business opportunity. If anyone is interested in trading on bitcoin or any cryptocurrency and want a successful trade without losing notify Mr Anderson now.Whatsapp: (+447883246472 )
    Email: tdameritrade077@gmail.com

    ReplyDelete