Set up VM SQL Server from Azure


Step 1: Create a VM from the gallary with your choice that include SQL Server version you need;

Step 2: Remote log in to the VM and change Windows permissions to allow  user(s ) to be able to “Perform volume maintenance tasks”;

(secpol.msc >>User Rights Assignment: https://sqlserverperformance.wordpress.com/2009/11/01/two-very-important-configuration-settings-for-sql-server-20052008/  )

Step 3: Add a data disk (Drive O in this sample) from Azure portal to the VM and initialize the disk from the VM;

(https://azure.microsoft.com/en-us/documentation/articles/virtual-machines-windows-classic-attach-disk/)

Step 4: Restore databases from backups either from copied local backup files (may need to move bak file large than 2G) or restore directly from an Azure storage account.

  
 
  
use master
go
 
OPEN Master Key Decryption  BY PASSWORD = 'myifbfpass$2014ForAzure'
Go

Restore DATABASE theDB
FROM URL = 'https://xyz.blob.core.windows.net/aserverInstance/theDB_3bc8ab8d4f8540acbfd7da39fc575b2e_20160323111645-05.bak' 
/* URL includes the endpoint for the BLOB service, followed by the container name, and the name of the backup file*/ 
WITH CREDENTIAL = 'myAzureStorage'
,File=1,NOUNLOAD, REPLACE, STATS = 10
 ,MOVE 'theDB' TO 'O:\MSSQL\theDB.mdf' 
,MOVE 'theDB_log' TO 'O:\MSSQL\theDB_Log.ldf' 
 

 

 

 

 

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s