Today I am going to talk about …hold on… where is my database? WHERE IS MY DATABASE?
It was there 5 minutes ago!! Where did it go? I spent a lot of time setting up the database for this blog. Ok! Do not panic! Do I have a backup? Oh yes! I just run a backup to Amazon S3 in my previous blog so ...relax...and let’s restore it.
First let’s open the Restore Wizard:
Then select the type of restore you want to perform
In this case I select the original name of the database and the same server but I could restore the database to a new server and /or with a new name if I wished
Yes, please! Continue! I want it and I want it now!
In the next step let’s choose the backup file to restore. Here it is where our backup and recovery strategy is crucial. Do we have a backup? Is this backup valid? Does it include the data I need now? etc (always practice and test your backup and recovery strategy...you do not want to find out it is not the appropriate one when being in a real disaster scenario).
In this case I am covered as I just run a backup of that database in Amazon S3 and it contains my last changes.
Let's go then! Select Device as Cloud:
Select the backup file:
And then select the options you prefer:
We can Run the restore immediately, in background or even schedule it. Since I need the database live and kicking as soon as possible and I am not going to do anything else in the meantime, I will select “Run immediately”
As always we can preview the script LiteSpeed will run by clicking “Preview Script” on the hyperlink
In this case the script is:
exec master.dbo.xp_restore_database @database = N'2AdventureWorks2012Dev' ,
@filename = N'2AdventureWorks2012Dev_201705171052.bak',
@filenumber = 1,
@CloudVendor = N'AmazonS3',
@CloudBucketName = N'litespeedbackupstest',
@CloudAccessKeyEnc = N'XXXXXXYYYYYYYYSSSSSSS',
@CloudSecretKeyEnc = N'XXXXXXXXXXYYYYYYYYSSSSSSSSSS',
@UseSSL = 1,
@with = N'STATS = 10',
@with = N'MOVE N''AdventureWorks2012_Data'' TO N''C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\2AdventureWorks2012Dev.mdf''',
@with = N'MOVE N''AdventureWorks2012_Log'' TO N''C:\Program Files\Microsoft SQL Server\MSSQL11.MSSQLSERVER\MSSQL\DATA\2AdventureWorks2012Dev_1.ldf''',
@affinity = 0,
@logging = 0
And below we have the message we always want to read when restoring: "Successfully restored"
And here I have my database again! LiteSpeed saved me one more time!
And this is all for today.
Hope this helps!