Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 SQL Server Administration (2008)
 Sync Databases

Author  Topic 

jo.annes
Starting Member

3 Posts

Posted - 2011-03-01 : 06:42:48
Hi all,
This is my first post on this website. Hi to all.

I have a question that may have a very simple answer, or not...

I work in a company with two offices each with its SQL server and different databases DB1 and DB2. Recently half of the team from one office moved to the second one and now these people need to access the same database DB2. I created a VPN connection to enable people from both offices to work against the same database DB2. Unfortunately the VPN had to be removed due to a problem with a telephone software (...). What I did in order to save the day (or not)was to restore the same backup of the database in question DB2 in each server of each office. The problem, which you may be already guessing is that now I have the same database DB2 with one day of work different from each other... I have the DB2 database with the work from one office another DB2 with the work from another office. I tried to take the transaction Log Backups from one DB2 and restore them them on the other DB2 but it didn't work as intended...

I'm sure it must be a situation covered by SQL server but don't know how to do it. Any help would be appreciated...

Jose

jo.annes
Starting Member

3 Posts

Posted - 2011-03-01 : 07:30:56
... in case it's not clear, mainly I want to merge both databases so they can have exactly the same data...
I tried applying transaction log backups from each other but it returns an error...

Thank you
Go to Top of Page

Peter99
Constraint Violating Yak Guru

498 Posts

Posted - 2011-03-01 : 10:46:22
Did you try replication?
Go to Top of Page

jo.annes
Starting Member

3 Posts

Posted - 2011-03-01 : 11:13:10
Thank you for your reply Peter.

What I need to achieve is to copy the transactions from database A which are not on database B and vice versa.
I assume replication will wipe out one of the set of transactions from one of the databases.
If I'm wrong I'll give it a try...

Best regards,
Jose
Go to Top of Page

dinakar
Master Smack Fu Yak Hacker

2507 Posts

Posted - 2011-03-01 : 12:20:16
You can try Merge replication but the tools dont understand business logic. If this is a one time effort you might want to manually sync up the tables.. restore the database from one location onto another with a different database name and run some queries to find whats different and pump the data back into whichever db has the most data so you are migrating least amount of data.

Dinakar Nethi
************************
Life is short. Enjoy it.
************************
http://weblogs.sqlteam.com/dinakar/
Go to Top of Page

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2011-03-01 : 12:20:49
MERGE Replication is designed to handle situations where both sides would be making changes to the data.

I am a bit confused though. If the two sites can communicate enough to allow replication to be an option, then why can't users from site #2 simply log into the database at site #1 and only support the single instance?

=======================================
Elitism is the slur directed at merit by mediocrity. -Sydney J. Harris, journalist (1917-1986)
Go to Top of Page
   

- Advertisement -