Red Gate forums :: View topic - Automate restore
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SQL Virtual Restore 2
SQL Virtual Restore 2 forum

Automate restore

Search in SQL Virtual Restore 2 forum
Post new topic   Reply to topic
Jump to:  
Author Message
Andrew Hodge



Joined: 19 Jul 2007
Posts: 90
Location: Kent, UK

PostPosted: Mon Apr 18, 2011 4:49 pm    Post subject: Automate restore Reply with quote

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....
Back to top
View user's profile Send private message
chriskelly



Joined: 19 Apr 2010
Posts: 329
Location: Cambridge, UK

PostPosted: Wed Apr 20, 2011 5:08 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Andrew Hodge



Joined: 19 Jul 2007
Posts: 90
Location: Kent, UK

PostPosted: Thu Apr 21, 2011 8:02 am    Post subject: Reply with quote

Thanks, totally missed the view script button on the summary page (step 4) of the virtual restore wizard.
Back to top
View user's profile Send private message
Andrew Hodge



Joined: 19 Jul 2007
Posts: 90
Location: Kent, UK

PostPosted: Thu Apr 21, 2011 8:09 am    Post subject: Reply with quote

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/Content?p=SQL%20Virtual%20Restore&c=SQL_Virtual_Restore/help/2.2/svr_examples_create_database_virtual_restore.htm&toc=SQL_Virtual_Restore/help/2.2/toc132667.htm
Back to top
View user's profile Send private message
Andrew Hodge



Joined: 19 Jul 2007
Posts: 90
Location: Kent, UK

PostPosted: Thu Jul 21, 2011 11:35 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Colin Millerchip



Joined: 31 Oct 2007
Posts: 66
Location: Cambridge, UK

PostPosted: Wed Aug 17, 2011 3:04 pm    Post subject: Re: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
SQLDBAsa



Joined: 10 Aug 2011
Posts: 5

PostPosted: Thu Apr 12, 2012 3:21 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message
Colin Millerchip



Joined: 31 Oct 2007
Posts: 66
Location: Cambridge, UK

PostPosted: Fri Apr 13, 2012 11:04 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message Send e-mail
sqlphilosopher



Joined: 28 Jan 2013
Posts: 1

PostPosted: Mon Jan 28, 2013 9:44 am    Post subject: My hyperbac restore script Reply with quote

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/01/my-red-gate-hyperbac-dbcc-checkdb-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
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group