Pages

Friday, 25 April 2014

Restoring a SQL Database with VDP Advanced

In a previous article I showed how to backup a SQL database with the VDP Advanced agent. This article is going to show you how to restore a database from backup in the event that you accidentally deleted the database or want to restore over the top of the existing database. For this test I created a new database called TestDB in simple recovery mode and created a table called dbo.Test:

I then performed an application backup of the SQL server to capture the newly created database:

Performing a restore of a deleted database
In the first example I am going to delete the database and then perform a restore from backup. As you can see, I've now deleted the database from the SQL server:

In order to perform a restore simply navigate to the VDP plugin and click the Restore tab and navigate down the tree structure until you find the database that you wish to restore. Check it and then click the Restore button:

Verify the database that you have selected is correct and click Next:

Leave the Restore to original location check ticked and expand the Advanced Options and uncheck the Tail-log backup option. The tail-log backup option is only used for databases that use the full or bulk-logged recovery model. Once finished click Next:

Verify your settings and click Finish:

The restore job should start and you can monitor this via the Tasks pane within the web client. Once it's completed you should see the database has been restored with all data (Refresh SQL Management Studio if you left it open):

Performing a restore over an existing database
In this example I'm going to show you how to restore a database over the existing database. This is handy if you've accidentally deleted some data or some data is potentially corrupt. For this example I'm going to delete the dbo.Test table and then perform the restore over the top of the existing database. As you can see the table has been deleted:

Perform exactly the same steps as per the previous example and then monitor the job to ensure it completes successfully and then referesh the view in SQL Management Studio and you should see the returned data:

If you are experiencing any issues with the restore then check out the log files on the client at the following location: