Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Every night I create a backup (to disk) of a particular database. Subsequently that backup has to be restored to 2 different servers. These restores now happen sequentially and take about half an hour per restore.

Would it be possible/wise/faster to execute the 2 restores in parallel?

share|improve this question
    
are you trying to replicate a database by backing up and restoring it, why don't you use mirroring or replication –  AmmarR Jun 27 '12 at 9:18
    
I know that there are better solutions available, but for now I should get this to work. –  Tino Jun 27 '12 at 9:34
    
restoring the same file to 2 different databases on same server parallel is possible, but if you want to restore it to 2 different servers it wont be parallel, because the file has to be available on the server physically, so you will need to have a copy of the file on the 2 servers. and yeah possible as well... or if you have the file on a mapped drive and both servers can see the same file on the same mapped network location, again its possible. –  AmmarR Jun 27 '12 at 9:53
    
The backup file is located in a network folder, so it is accessible to both servers. What about performance? Will it be faster than restoring sequential? –  Tino Jun 27 '12 at 10:34
    
hi tino, i added a Post below check it –  AmmarR Jun 27 '12 at 11:32
show 1 more comment

2 Answers

up vote 2 down vote accepted

I am pretty sure that I have done this, though I didn't think twice about it at the time.

You definitely can restore a bak file using a UNC path. Mapping drive letters is to be avoided because the mapping must be done in the context of the SQL service account. Most people map the drive under their own account and are frustrated when the restore command doesn't work as they expect.

Naturally, there will be a little more load on the NIC on the server that holds the BAK file and there could be some contention if the database mdf and ldf files are on the same SAN, but these are probably minor problems, if you notice them at all.

share|improve this answer
add comment

Usually its suggested that Using multiple backup devices for backup and restore operations enables SQL Server to use parallel I/O to increase the speed of backup and restore operations because each backup device can be written to or read from at the same time as other backup devices. For enterprises with large databases, using many backup devices can greatly reduce the time taken for backup and restore operations. SQL Server supports a maximum of 64 backup devices for a single backup operation.

this is the opposite of the way you are doing it, so yeah restoring 2 database from the same media device will effect performance because IO operations are happening on the same disk at the same time.

Copying the data and transaction log from the backup devices to the database and transaction log files is performed by reader/writer threads; one thread is assigned to each backup device.

performance increases with the number of backup devices and in your case its the opposite, so Performance decreases if you are using 1 backup device to restore 2 different databases

for more on Backup and Restore Performance in SQL Server check section Using Multiple Media or Devices

So i guess the answer to your question, is Its possible to restore 2 databases from same file but not Wise

share|improve this answer
1  
To add to this - It would be interesting to observe the performance restoring two databases on different servers from a single backup file simultaneously vs make a copy of the backup file on the same drive, restore two databases from backup.bak and backup-copy.bak and see which method is better. I can't test this at work, for we dont need such a process and can't test it at home too - dont have necessary setup :( –  yogirk Jun 27 '12 at 11:43
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.