Issue with using sqlvdbcmd command line to create virtual database

by Aug 12, 2015

I’ve been using SQL virtual database console UI for a few years now and am exploring using the command line tool in order to automate virtualization of databases through jobs. I’m noticing that when I virtualize a database using the console UI, the virtual database properties in SQL Server Management Studio shows the MDF/LDF file path as C:Program FilesIderaSQL virtual databaseFilterMetaData<servername> and that we do not actually claim the original size of the MDF/LDF files. Besides small metadata files, the only space required is for the .safe backup file. (This is as expected,)

When I use the sqlvdbcmd command line tool to virtualize a database (sqlvdbcmd Create MyVirtualDatabase D:DatabaseBackupName.safe), SQL Server Management Studio shows the MDF/LDF file path as D: (the original location of the backup folder) and actually recreates the MDF/LDF file in that location. So instead of simply requiring space only to support the .safe backup file, it requires space for the .safe, .mdf, and .ldf files. When I attempt to delete the .mdf/.ldf files, I am warned that they are in use by SSMS, which says to me that it didn’t actually virtualize the database (it isn’t reading the .safe file) it just restored the MDF/LDF files and is reading those.

Why does the sqlvdbcmd command line tool behave differently than the console UI when virtualizing databases? How can I use sqlvdbcmd command line to truly virtualize my databases? To me the benefit of this tool is being able to read the smaller .safe files and remove the .mdf/.ldf files from the server in order to reclaim space. And using the command line tool is not achieving that benefit – it does not seem to be working as advertised. I’d appreciate any support/guidance on this matter!