Comments
Sort by recent activity
I am looking to automate doing virtual restores on a number of databases after each nightly backup. The extended sp does this nicely, but it doesnt take advantage of the virtual restore feature -- too bad.
Using native sql then for each database that I want to check, I need something like this:
-- Script generated by Red Gate SQL Virtual Restore v2.4.0.164
-- Multi-threaded SQL Backup backups are handled by repeating the DISK parameter in the RESTORE command, once for each thread used during the backup process.
RESTORE DATABASE [MyDB_Virtual] FROM
DISK=N'D:\SQLBackup\MyDB\MyDB_FULL_20130205201700.sqb',
DISK=N'D:\SQLBackup\MyDB\MyDB_FULL_20130205201700.sqb',
DISK=N'D:\SQLBackup\MyDB\MyDB_FULL_20130205201700.sqb'
WITH MOVE N'MyDB_Data' TO N'F:\SQLBackup\MyDB\MyDB_MyDB_Virtual.vmdf',
MOVE N'MyDB_Log' TO N'F:\SQLBackup\MyDB\MyDB_MyDB_Virtual.vldf',
NORECOVERY, STATS=1
GO
RESTORE DATABASE [MyDB_Virtual] FROM
DISK=N'D:\SQLBackup\MyDB\MyDB_DIFF_20130207220005.sqb',
DISK=N'D:\SQLBackup\MyDB\MyDB_DIFF_20130207220005.sqb',
DISK=N'D:\SQLBackup\MyDB\MyDB_DIFF_20130207220005.sqb'
WITH NORECOVERY, STATS=1
GO
RESTORE DATABASE [MyDB_Virtual] WITH RECOVERY, RESTRICTED_USER
GO
DBCC CHECKDB ([MyDB_Virtual])
GO
DROP DATABASE [MyDB_Virtual]
GO
Obviously, this script changes each night in terms of file names and, if for some reason, the number of threads used changes.
So, is there something available that will generate this sort of sql given a database name and the folder that holds the full+diff backups?
Thanks. / comments
I am looking to automate doing virtual restores on a number of databases after each nightly backup. The extended sp does this nicely, but it doesnt take advantage of the virtual restore feature -- ...
Does this question have to now be raised in a different forum? / comments
Does this question have to now be raised in a different forum?
Thanks for the response.
I reason I opted for the extended sp is because it accepts "...\*.sqb" and then figures out which files (full or full+diff) and the number of threads used, which is not a simple thing!
So are you saying that there is no way to do a virtual restore via the extended sp? / comments
Thanks for the response.
I reason I opted for the extended sp is because it accepts "...\*.sqb" and then figures out which files (full or full+diff) and the number of threads used, which is not a s...