Let's first destroy a little bit:
And then let's ask our colleague to send us all the information about the Human Resources department :
Luckily us we just run a backup on Azure for this database. In this blog we will run the restore by Right clicking the backup we want to restore. To do that we select the Database in the "Backup Manager" and then, on the right hand, we select the "Backup History" tab.Then we select the backup to restore and we Right click on it.Remember that we can also use the Restore option in the main menu instead (as we did in a previous blog ).
As you can see we jump directly to the "BackUp Files" section of the "Restore Wizard" and even there we have all the data populated:
From now the wizard is exactly the same as if we were restoring from disk or Amazon. Anyway I will add the screens here for your reference.
As always we can see the script LiteSpeed will run by clicking on the "Preview Script" hyperlink.
In this case the script is:
---- Kill all current connectionsDECLARE @cmdKill VARCHAR(50)DECLARE killCursor CURSOR FORSELECT 'KILL ' + Convert(VARCHAR(5), p.spid)FROM master.dbo.sysprocesses AS pWHERE p.dbid = db_id('2AdventureWorks2012Dev')OPEN killCursorFETCH killCursor INTO @cmdKillWHILE 0 = @@fetch_statusBEGINEXECUTE (@cmdKill) FETCH killCursor INTO @cmdKillENDCLOSE killCursorDEALLOCATE killCursor -----------------------exec master.dbo.xp_restore_database @database = N'2AdventureWorks2012Dev' ,@filename = N'lll\2AdventureWorks2012Dev_201707031330.bak',@filenumber = 1, @CloudVendor = N'AzureBlob', @CloudBucketName = N'aatestcont1', @CloudAccessKeyEnc = N'XZXXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZZZZZZ', @CloudSecretKeyEnc = N'XZXXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZZZZZZXZXXXXXXXXXXXXYYYYYYYYYYYYZZZZZZZZZZZZZ', @UseSSL = 1,@with = N'REPLACE',@with = N'STATS = 10',@affinity = 0,@logging = 0GO
Hooray!!!! The database has been restored!
Let's continue with our job now and get the information we need!
Hope this helps!