
Using Multiple Media or Devices
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 is limited by either the ability of the backup devices to deliver the data or the ability of the database and transaction log files to accept the data. Therefore, performance increases with the number of backup devices, until the maximum throughput of the database or transaction log files to accept the data is reached.
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.
While a backup is being written to multiple backup devices, several internal synchronization points occur. The most important such point occurs when all the data in the database has been backed up and the transaction log is about to be backed up.
Important: |
|---|
|
When multiple backup devices are used to perform backup operations, the backup media involved can be used only for SQL Server backup operations. For more information, see Using Backup Media.
|
Creating and restoring backups when you use multiple backup devices is the same as creating and restoring backups when you use a single device. The only difference is that you must specify all backup devices involved in the operation, not just one. For example, if a database backup is to be created that uses three tape backup devices such as \\.\TAPE0, \\.\TAPE1, and \\.\TAPE2, each of the tape devices must be specified as part of the backup operation, although fewer tape backup devices can be used when you restore the backup later.
When you create a backup on multiple backup devices by using removable media, the devices can operate at different speeds and the media volumes can have different amounts of space available. During the backup operation, if the media volume on a backup device runs out of space, the operation stops writing to that device and prompts you for a new media volume. Until you replace the filled media volume with an empty volume, that device is blocked. Meanwhile, the backup operation continues writing data to the devices whose media still have space available. When you replace the filled media volume, its device becomes available and the backup resumes writing data to that device. However, be aware that if an internal synchronization point occurs while any device is blocked, the backup operation pauses entirely until that device is made the available again.
Example
Consider a scenario that uses three tape backup devices of equal speed to store a full database backup. The first two tapes have 10 gigabytes (GB) of available space, but the third has only 5 GB available. If a 20-GB database is backed up to all three tape backup devices simultaneously, the third tape will fill up before the backup completes. After 5 GB of data have been written to the third tape, the backup operation stops writing to the third device. The operation blocks that device and prompts for a new tape. Meanwhile, the backup operation continues writing data to the other two devices. However, before the third tape is replaced, an internal synchronization point occurs. At that point, the whole backup operation pauses until a new tape is mounted on the third device.