sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Tjeez's Avatar

Synchronizing/Replication between MS SQL & DB2


Question posted by: Tjeez (Guest) on November 23rd, 2005 11:15 AM

Hi folks,

I'm totally not familiar with DB2 databases, but for a project at work
I need to synchronize a MS SQL database with a DB2 database. The MS SQL
server is (offcourse) on a Windows 2003 server, while the DB2 database
is on a non-windows environment.

Now I wonder what is the best way to accomplish
synchronisation/replication? Is there a built-in tool to do this, will
I need third party software, or will I need to write my own
synchronization application (there is a log table which keeps track of
all changes made to any record)?

I know there is the db2 load or import command. Is it possible to
invoke that command from a C# application with the DB2 .Net Data
Provider or any other data provider?

Thanks in advance!


--
Tjeez
Message posted via http://www.exforsys.com for all your training needs.

6 Answers Posted
Brian Tkatch's Avatar
Guest - n/a Posts
#2: Re: Synchronizing/Replication between MS SQL & DB2

I do not know which is bestm but IIRC, SQL Server comes with DTS
Packages that should make this pretty easy.

B.

Tjeez's Avatar
Guest - n/a Posts
#3: Re: Synchronizing/Replication between MS SQL & DB2


Brian Tkatch Wrote:[color=blue]
> I do not know which is bestm but IIRC, SQL Server comes with DTS
> Packages that should make this pretty easy.
>
> B.[/color]
Thanks for your reply. But I'm not sure how to do this with a DTS. Is
it not impossible to connect to DB2 (non-Windows) from MS SQL Server?

I was thinking to retrieve all changed records (per table), put them in
a delimited file and then use the db2import command tool (with
'INSERT_UPDATE' as a parameter) for each file to 'synchronize' the DB2
database. The only thing I don't know is how to specify records that
must be deleted (other than using a regular SQL statement).

I also must consider buying a third software application to do this. I
must check which is better to maintain, which is cheaper, which is
best, ...


--
Tjeez
Message posted via http://www.exforsys.com for all your training needs.

Brian Tkatch's Avatar
Guest - n/a Posts
#4: Re: Synchronizing/Replication between MS SQL & DB2

> But I'm not sure how to do this with a DTS.

Create an ODBC connection to DB2, then in DTS add the object for each
database and use an action run a SQL statement. Or something like that,
i haven't done it in a while.
[color=blue]
>Is it not impossible to connect to DB2 (non-Windows) from MS SQL Server?[/color]

Isn't that what ODBC is for?
[color=blue]
>I was thinking to retrieve all changed records (per table), put them in
>a delimited file and then use the db2import command tool (with
>'INSERT_UPDATE' as a parameter) for each file to 'synchronize' the DB2
>database. The only thing I don't know is how to specify records that
>must be deleted (other than using a regular SQL statement).[/color]

Hmm.. good question. I don't know the best way.

B.

juliane26's Avatar
Guest - n/a Posts
#5: Re: Synchronizing/Replication between MS SQL & DB2

You can use DB2 built-in replication software, but that would need an
additional license for Information Integrator.

Then DB2 would take care of the changes and apply and purge them. It
would accomplish that using so called 'change data'-tables. Those would
be filled asynchronously reading the log files in DB2 and using
triggers in SQL server.

I dunno MS solutions - I am sure there is something on this side as
well - to accomplish that or any other third-party product.

If you write it on your own, you have to take care of all that
yourself. Whether that is useful depends very much on the complexity of
the data you want to replicate; and whether you need too keep
informations about transactions (e.g. OLTP) or just want to copy some
data. For loading some data into a (small) DWH an own solution using
triggers or just coying data might be cheaper.

Tjeez's Avatar
Guest - n/a Posts
#6: Re: Synchronizing/Replication between MS SQL & DB2


Thanks for your replies! I will take a look at both DTS and Information
Integrator.


--
Tjeez
Message posted via http://www.exforsys.com for all your training needs.

db2team@hotmail.com's Avatar
db2team@hotmail.com November 24th, 2005 05:45 PM
Guest - n/a Posts
#7: Re: Synchronizing/Replication between MS SQL & DB2

You might also want to take a look at StarQuest Data Replicator,
another excellent replication tool for DB2 & MS SQL!

Details here: http://www.starquest.com/Productfolder/infoSQDR.html

Bob

Tjeez wrote:[color=blue]
> Thanks for your replies! I will take a look at both DTS and Information
> Integrator.
>
>
> --
> Tjeez
> Message posted via http://www.exforsys.com for all your training needs.[/color]

 
Not the answer you were looking for? Post your question . . .
196,947 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,947 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors