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?
Sql-server – Replicate DB2 table to SQL Server 2008
db2replicationsql serversql-server-2008
Related Question
- Sql-server – SQL Server 2008, cpu 100% until recreate an index
- Sql-server – Duplicate primary key in bulk insert after truncate in SQL Server 2008
- Sql-server – SQL Server using incorrect plan
- Sql-server – Advice for ETL from Oracle to SQL Server
- Sql-server – Update existing SQL Server 2008 table via Flat File using SSIS
- Sql-server – SymmetricDS Setup – SQL Server 2008 to MySQL
- Sql-server – Can’t install a OLE DB Provider for IBM DB2 ISeries on SQL Servers higher than 2008 version
- DB2 to SQL Server – Data Transfer Between Servers
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 lastint
value replicated. The replication process would grab any new records, and update the small table's value to reflect the last value replicated.