Automate restore

SQL Virtual Restore: Rapidly mount live, fully functional databases direct from backups

Moderators: eddie davis, Colin Millerchip, fionag

Automate restore

Postby Andrew Hodge » Mon Apr 18, 2011 4:49 pm

Is there anyway to automate a virtual restore ie perform the virtual restore via a SQL script.

Had a quick look through the help and this forum and cant see anything obvious....
Andrew Hodge
 
Posts: 90
Joined: Thu Jul 19, 2007 8:34 am
Location: Kent, UK

Postby chriskelly » Wed Apr 20, 2011 5:08 pm

It should be possible to add the SQL Virtual Restore script to a new job in the SQL Server Agent. It is relatively straight forward to do this through SSMS. You can then configure this job to run to whatever schedule you feel is appropriate.

(How to create a sql server agent job)
http://msdn.microsoft.com/en-us/library/ms190268.aspx
chriskelly
 
Posts: 330
Joined: Mon Apr 19, 2010 1:44 pm
Location: Cambridge, UK

Postby Andrew Hodge » Thu Apr 21, 2011 8:02 am

Thanks, totally missed the view script button on the summary page (step 4) of the virtual restore wizard.
Andrew Hodge
 
Posts: 90
Joined: Thu Jul 19, 2007 8:34 am
Location: Kent, UK

Postby Andrew Hodge » Thu Apr 21, 2011 8:09 am

Must of been having a slow 5 minutes because it is also documented on the bottom of this page....

http://www.red-gate.com/supportcenter/C ... 132667.htm
Andrew Hodge
 
Posts: 90
Joined: Thu Jul 19, 2007 8:34 am
Location: Kent, UK

Postby Andrew Hodge » Thu Jul 21, 2011 11:35 am

The problem with this is you cant restore filenames based on wildcard like you can in sqlbackup.

So if you have a backup name that changes due to including the date and time then it becomes difficult to script for.

Can I have a feature request of allowing the virtual restore to allow wildcard filenames
Andrew Hodge
 
Posts: 90
Joined: Thu Jul 19, 2007 8:34 am
Location: Kent, UK

Re:

Postby Colin Millerchip » Wed Aug 17, 2011 3:04 pm

Andrew Hodge wrote:The problem with this is you cant restore filenames based on wildcard like you can in sqlbackup.

So if you have a backup name that changes due to including the date and time then it becomes difficult to script for.

Can I have a feature request of allowing the virtual restore to allow wildcard filenames

Sorry for the loooong delay in replying, this slipped through due to holiday breaks.

This request is also covered in this thread http://www.red-gate.com/MessageBoard/viewtopic.php?p=49845

The short version is that SQL Virtual Restore uses native T-SQL syntax, and as such the approach proposed by epetro in the other thread (dynamic T-SQL) is the way to do this. That said, we're working on making scheduling easier to do, but I can't provide details on this yet.
Colin Millerchip
 
Posts: 66
Joined: Wed Oct 31, 2007 5:31 pm
Location: Cambridge, UK

Postby SQLDBAsa » Thu Apr 12, 2012 3:21 pm

Hi Guys - any update on this?

I would really like to automate my daily restores with Virtual restore - as I am using date time filenames it's difficult to get them inside a tsql script to run thought a job.

If someone has an working solutions I would greatly appreciate it.

Regards,
R
SQLDBAsa
 
Posts: 5
Joined: Wed Aug 10, 2011 11:35 am

Postby Colin Millerchip » Fri Apr 13, 2012 11:04 am

FYI, there's a blog post at http://www.sqlphilosopher.com/wp/2012/02/perform-dbcc-checkdb-weekly-using-red-gate-sql-virtual-restore/ where the author describes a script that handles the complexity of the dynamic t-sql. If you reach out to him, perhaps he'll share it?

Best regards,


Colin.
Colin Millerchip
 
Posts: 66
Joined: Wed Oct 31, 2007 5:31 pm
Location: Cambridge, UK

My hyperbac restore script

Postby sqlphilosopher » Mon Jan 28, 2013 9:44 am

Here is the Script that I wrote to handle the complexity of restoring each database on a given instance, using hyperbac virtual restore, and then performming DBCC Check DB Against it:

http://www.sqlphilosopher.com/wp/2013/0 ... db-script/

I apologize that it took me so long to get it pulled together.
SQLPhilsopher
the unindexed table is not worth querying
http://www.sqlphilosopher.com
sqlphilosopher
 
Posts: 1
Joined: Mon Jan 28, 2013 9:41 am


Return to SQL Virtual Restore 2

Who is online

Users browsing this forum: No registered users and 0 guests