Sql-server – Replicate DB2 table to SQL Server 2008

db2replicationsql serversql-server-2008

I need to replicate data from a DB2 database into a SQL Server Database (along the lines of about 80 tables). I can create an SSIS package, to just flat copy the data from one to another pretty easy, but the amount of records is a couple million, so doing it once takes a while, but for the initial setup its fine. However, I need to do "almost" real-time updates, so this method won't be viable. What would be the best method, and how, to do just add change and delete replication from DB2 to SQL Server?

Best Answer

You could create a hidden timestamp column in DB2 on the replicated tables. When you run the replication job you can pull just the data that has changed since the last replication. This would lower the quantity of data sent.

For instance, run the SSIS package every minute pulling just the last minutes worth of data.

Or, instead of a timestamp field, you could use an auto incrementing int and keep a small table on the replicated instance that records the last int value replicated. The replication process would grab any new records, and update the small table's value to reflect the last value replicated.