views:

3785

answers:

2

Hello everyone,

I have one database which contains the most recent data, and I want to replicate the database content into some other servers. Dues to non-technical reasons, I can not directly use replicate function or sync function to sync to other SQL Server instances.

Now, I have two solutions, and I want to learn the pros and cons for each solution. Thanks!

Solution 1: detach the source databse which contains the most recent data, then copy to the destination servers which need the most recent data, and attach database at the destination servers;

Solution 2: make a full backup of source server for the whole database, then copy data to destination servers and take a full recovery at the destination server side.

thanks in advance, George

+1  A: 

The Detach / Attach is often quicker than performing a backup as it doesn't have to create a new file. Therefore therefore the time from server a to server b is almost purely the file copy time.

The Backup / Restore option allows you to perform a full backup, restore than, then perform a differential backup which means your down time can be reduced between the two.

If its data replication you're after, does that mean you want the database functional in both locations? In that case, you probably want the backup / restore option as that will leave the current database fully functional.

EDIT: Just to clarify a few points. By downtime, I mean that if you're migrating a database from one serer to another. You generally will be stopping people using it whilst it's in transit. Therefore, from the "stop" point on Server A up to the "start" point on Server B this could be considered downtime. Otherwise, any actions performed on the database on server A during transit will not be replicated onto server B.

In regard to the "create a new file". If you detach a database you can copy the MDF file immediately. It's already there ready to be copied. However, if you perform a backup, you have to wait for the .BAK file to be created and then move it to it's new location for a restore. Again this all comes down to is this a snapshot copy or a migration.

Robin Day
Two confusions:1. "it doesn't have to create a new file" -- new file you mean?2. "down time can be reduced between the two" -- why there is downtime? I think for SQL Server duing full backup and full recovery model, there is no downtime for both source/destination server?
George2
"If its data replication you're after, does that mean you want the database functional in both locations?" -- both source and destination server could endure downtime, but I want to keep downtime of destination server as short as possible. Any new advice about the best solution?
George2
Thanks Robin, read your edited comments. So the new file you mean .bak file?Another question, when using attach/detach, will there be any transaction logs at both source database server or destination database server?
George2
On pressing Detach... The database is taken offline. It will no longer be part of Server A. It will only become available on Server B once you Attach it. I think what you're describing is replicating a snapshot of your db on a second server. Therefore, backup / restore is the way to go.
Robin Day
Thanks Robin, I think for attach/detach operation themselves, will there be any transaction log generated?How about backup/recovery, any additional transaction log generated?
George2
There will be no additional transaction log, just the mdf and ldf files. The database is taken offline when detaching so no more data is processed
Robin Day
+1  A: 

Solution 2 would be my choice... Primarily becuase it won't create any downtime on the source database. The only disadvatage i can see is that depending on the database recovery model, the transaction log will be truncated meaning if you wanted to restore any data from the transaction log you'd be stuffed, you'd have to use your backup file.

EDIT: Found a nice link; http://sql-server-performance.com/Community/forums/p/5838/35573.aspx

GordonB
I can ensure during backup of source database, there is no insert/delete/update operations, and on destination database, it is readonly all the time (all modifications are on source database). So, in my case no transaction log for both full backup on source server
George2
and full recovery on destination server?
George2
when using attach/detach, will there be any transaction logs at both source database server or destination database server?
George2