Backing up & restoring 10-20 SQL Server databases to a ~synchronous state?
I need to backup up 10-20 SQL Server dbs used simultaneously by a single enterprise app, while they are online, in such a way as to restore them to a state that is largely synchronized across all dbs
What you are looking for is a consistent backup across all your customer databases, you should use FULL backups along with Marked Transactions
(emphasis in bold added):
When you make related updates to two or more databases, related databases, you can use transaction marks to recover them to a logically consistent point. However, this recovery loses any transaction that is committed after the mark that was used as the recovery point. Marking transactions is suitable only when you are testing related databases or when you are willing to lose recently committed transactions.
Make sure that you take adhoc transaction log backup with COPY_ONLY
, else your recovery will be a pain, since any adhoc transaction log backup without COPY_ONLY
will break the log chain. As a precaution, you can restrict users to use only COPY_ONLY
backups.
I need a solution for SQL Server versions 2008 R2 and later. Db sizes is up to 50 GB per db and the time to backup all of them is likely over 1-2 hours.
Marked transactions will work for your situation. The only thing to make parallel backups is to STRIPE
them, but then you end up making sure that you don't lose your stripes of backup. To make them faster, you can play with BUFFERCOUNT
and MAXTRANSFERSIZE
.
You should use backup compression as well as enable Instant file initialization.
Refer to
- Using Marked Transactions (Full Recovery Model)
- How to increase SQL Database Full Backup speed using compression and Solid State Disks ?
If you are running full backups as well as transaction log backups (and you should if you consider this data important) you could just copy over the backups and transaction log backups to the test system and perform a point in time restore to restore the databases to +- the same time.
Depending on whether all databases reside on the same SQL Server machine or how well the servers clocks are synchronized you should be able to match the 'couple of seconds desynchronization' target.
It may be a bit of a band-aid solution but would meet the requirements and be fairly simple and inexpensive.
If you don't have full backups and transaction log backups from your important databases (which are in full recovery) you really need to revise your backup strategy. SAN level snapshots really moot the point of having a database in full recovery mode as you won't be able to do a point in time restore anyway.
Please read what MrDenny has to say about it