| Author |
Message |
Andrew Hodge
Joined: 19 Jul 2007 Posts: 90 Location: Kent, UK
|
Posted: Mon Apr 18, 2011 4:49 pm Post subject: Automate restore |
|
|
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 |
|
 |
chriskelly
Joined: 19 Apr 2010 Posts: 251 Location: Cambridge, UK
|
Posted: Wed Apr 20, 2011 5:08 pm Post subject: |
|
|
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 |
|
 |
Andrew Hodge
Joined: 19 Jul 2007 Posts: 90 Location: Kent, UK
|
Posted: Thu Apr 21, 2011 8:02 am Post subject: |
|
|
| Thanks, totally missed the view script button on the summary page (step 4) of the virtual restore wizard. |
|
| Back to top |
|
 |
Andrew Hodge
Joined: 19 Jul 2007 Posts: 90 Location: Kent, UK
|
|
| Back to top |
|
 |
Andrew Hodge
Joined: 19 Jul 2007 Posts: 90 Location: Kent, UK
|
Posted: Thu Jul 21, 2011 11:35 am Post subject: |
|
|
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 |
|
 |
Colin Millerchip
Joined: 31 Oct 2007 Posts: 42 Location: Cambridge, UK
|
Posted: Wed Aug 17, 2011 3:04 pm Post subject: Re: |
|
|
| 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 |
|
 |
SQLDBAsa
Joined: 10 Aug 2011 Posts: 5
|
Posted: Thu Apr 12, 2012 3:21 pm Post subject: |
|
|
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 |
|
 |
Colin Millerchip
Joined: 31 Oct 2007 Posts: 42 Location: Cambridge, UK
|
|
| Back to top |
|
 |
sqlphilosopher
Joined: 28 Jan 2013 Posts: 1
|
|
| Back to top |
|
 |
|