Overview

Microsoft SQL Server Virtual Backup

Microsoft SQL Server Virtual Backup Device Specification

Overview

The interface will be available on all Microsoft® SQL Server™ platforms, including Microsoft Windows® 98. The VDI was introduced with SQL Server version 7.0. It is not supported by earlier versions of SQL Server. SQL Server 2000 will continue to support named pipes; however, VDI is the preferred mechanism. Support for named pipes may be removed from SQL Server in a future release.

This illustration shows the relationships among the virtual device, SQL Server, and third-party backup applications.

The virtual device provides an interface to SQL Server that allows an application to act as a storage device. The client application implements the virtual device. SQL Server writes to the virtual device during backup and reads from the virtual device during restore.

The virtual device provides a server interface that accepts device-like commands, and a client application interface that executes those commands and provides notification of command completions. Shared memory is used for efficient buffering (that is, no extra data copies). An application should perform as well as SQL Server with direct device control. The client application must be running on the same computer as SQL Server.

Note   The server side interface is described for information purposes only. This interface is used exclusively by the SQL Server process.

This illustration shows the communication between the client and the server during the active, data-transfer phase of operation.

During backup, SQL Server writes a stream of data to a virtual device. In some cases, reading and positioning of the device is necessary. During restore, it reads a stream of data from a virtual device. The stream read must be identical to the stream written.

SQL Server allocates a buffer, and then reads or writes data to a virtual device by issuing a command. The client performs the requested action and indicates completion of the command. During the command processing, the client has exclusive control of the buffer referenced by the command. Although it is critical that the client preserves the stream in the order it was written, command completions on a single virtual device may occur in any order. This facilitates the client's use of asynchronous input/output (I/O) operation. For example, the client can schedule I/O for one request, and then initiate a second request without waiting for completion of the first request.

Completion events are posted to SQL Server by means of a completion agent.

If multiple devices are specified, SQL Server reads or writes multiple streams in parallel, one per device. Streams are independent in terms of data content, but at certain times during the backup or restore operation, SQL Server must synchronize the streams. It is possible for a GetCommand on one virtual device to block while SQL Server waits for activity to complete on another virtual device. When this synchronization occurs can vary from version to version.

Multiple virtual devices are typically used in situations when the client is backing up to or restoring from more than one real device. If the number of virtual devices matches the number of physical backup devices, the client need not perform any multiplexing of the streams. The client typically has one thread or process for each virtual device.