![sql server vdi api sql server vdi api](https://image.slidesharecdn.com/sqlserver2012hadr24hopfinal-120421081840-phpapp01/95/sql-server-2012-ha-dr-24hopfinal-33-728.jpg)
![sql server vdi api sql server vdi api](https://cloud.netapp.com/hubfs/Azure%20Disk%20Storage%20for%20SQL%20Server-Blog%201200x672.jpg)
In the case of a backup, this will be the stream to which the raw bytes from SQL Server are written. The second parameter to the method is any object that derives from System.IO.Stream. I would like to point out at this point that while the example above backs up a database, you can also backup transaction logs, perform differential backups, verify a backup with restore verifyonly or any other command that you would normally issue to SQL Server via T-SQL. Of course, in a production grade application, you would likely lock this functionality down, but for the educational purposes of this article, I left it open. The purpose of this functionality is to allow for maximum flexibility when issuing commands to the SQL Server. This virtual device will be named within the component so you will need to use the ' WITH STATS = 1 When specifying the device to which you will backup or from which you will restore, you must specify a VIRTUAL_DEVICE. The first argument for this method is a string which represents a normal SQL Server backup or restore command with one requirement. This method takes two parameters as input and returns a void. The component in this article has one method named ExecuteCommand which, as the name implies, executes a backup or restore command to the VDI. Since the nature of the VDI is streaming data into and out of the SQL Server, it made sense to me to use a System.IO.Stream for communication between the. NET wrapper for the VDI using Managed C++. Since the API for the VDI is designed to be consumed by C/C++, it made sense to develop a. Once you have a firm handle on the technologies outlined here, you can see this reference for more details on the VDI specification. There are many other capabilities of the VDI such as multiple input and output streams, and various performance tweaking opportunities.
![sql server vdi api sql server vdi api](https://docs.microsoft.com/en-us/azure/virtual-machines/windows/sql/media/virtual-machines-windows-sql-server-app-patterns-dev-strategies/ic728008.png)
As such, only a very small subset of the VDI API is covered in this article.
Sql server vdi api how to#
This article is meant to cover the basics of the VDI API and how to integrate it into a. With that being the case, I set out to develop a Managed C++ component which will act as a bridge between the "Virtual Device Interface" (VDI) API and the. The only catch is that to the best of my knowledge, there is no easy way to access this API via the. Microsoft has published an API to access this functionality of SQL Server. This access allows you to perform any number of tasks on this data though the most common tasks are compressing and/or encrypting the data before it is written to disk. Having access to these virtual devices gives you access to the raw data that is passed into and out of SQL Server during a backup or restore operation. VD=Global\1dc77079-b2c4-23ea-9b25-4ae3b01260b1_SQLVDIMemoryName_0.The virtual device interface of SQL Server allows developers to define "virtual devices" for SQL Server to backup and restore databases and transaction logs. Next day I suggested another server to restore same database and it's completed successfully without any issue (32GB RAM and 8CPU's).īelow is the completed error description which is logged in eventvwr, I found an error - SQL VDI Error and backup team also facing same error.įinally restore not happened. When backup team started restore from tool (CommVault), restore failing continuously. I requested to my backup team to restore the same. I have a Prod database about 550GB and I want to restore on QA server (RAM - 132GB and CPU's - 16).