Configuration

Microsoft SQL Server Virtual Backup

Microsoft SQL Server Virtual Backup Device Specification

Configuration

At this point Microsoft® SQL Server™ is executing in parallel with the client. The virtual device set is in the Configurable state until the server completes the configuration of the virtual device. The client invokes IClientVirtualDeviceSet2::GetConfiguration to wait for this event. Meanwhile, SQL Server begins execution of the utility command and invokes IServerVirtualDeviceSet2::Open using the name provided by the first VIRTUAL_DEVICE clause. SQL Server inspects the virtual device configuration by using IServerVirtualDeviceSet2::GetConfiguration. If the configuration is satisfactory, the server proceeds to invoke IServerVirtualDeviceSet2::BeginConfiguration, RequestBuffers and CompleteConfiguration to complete the configuration. The server decides on the total buffer space requirement, device block size, and maximum transfer size by using defaults or input from the BUFFERCOUNT, BLOCKSIZE, and MAXTRANSFERSIZE options of the backup command. These options are specified as part of the WITH clause. For example:

BACKUP DATABASE MYDB TO 
VIRTUAL_DEVICE='{0D0F5BA0-B21A-4519-A961-A6E2292A17CA}'
WITH BLOCKSIZE=4096, BUFFERCOUNT=20, MAXTRANSFERSIZE=524288.

BLOCKSIZE is the size, in bytes, that is used as the device BLOCKSIZE. All data transfers are in integral multiples of this value. Values must be a power of 2 between 512 bytes and 64 kilobytes (KB) inclusive. If this option is not specified with the command, then a default number of 512 bytes is used.

BUFFERCOUNT is the total number of buffers (of size MAXTRANSFERSIZE) that is used by the BACKUP or RESTORE operation. When more than one virtual device is used, the buffers are used as needed and are not associated with any given device. Note that some smaller buffers may be used by SQL Server to handle the small meta data transfers. These small buffers are not included in the BUFFERCOUNT.

MAXTRANSFERSIZE is the size, in bytes, of the maximum input or output request which is issued by SQL Server to the device. The MAXTRANSFERSIZE must be a multiple of 64 KB. The range is from 64 KB through 4 megabytes (MB). If this option is not specified with the command, then a default of 64 KB is used.

When the configuration is complete, the virtual device set is in the Initializing state until all devices are open between the client and server, and the completion agent is started. The client uses IClientVirtualDeviceSet2::OpenDevice to obtain the IClientVirtualDevice interface to each of the virtual devices. At this point, the virtual device set is in the Active state and all devices are ready to begin work.