Vous êtes sur la page 1sur 18

Module 9

Deploying SQL Server on a


Microsoft Azure Virtual Machine
Module Overview

• Deploying SQL Server on Azure Virtual Machines


• Migrating a Database to a Microsoft Azure Virtual
Machine
Lesson 1: Deploying SQL Server on Azure Virtual
Machines

• Creating a SQL Server Architecture by Using Azure


Virtual Machines
• Demonstration: Provisioning an Azure Virtual
Machine
• Licensing SQL Server on Azure Virtual Machines
• High Availability in Azure Virtual Machines
• Disaster Recovery in Azure Virtual Machines
• Automated Patching for SQL Server in Azure
Virtual Machines
Creating a SQL Server Architecture by Using
Azure Virtual Machines

• Running SQL Server on Azure virtual machines


• Connecting on-premises clients to SQL Server on
Azure virtual machines
• Replicating on-premises architectures in Azure
• Hybrid Architectures
Demonstration: Provisioning an Azure Virtual
Machine

In this demonstration, you will see how to:


• Provision an Azure virtual machine with SQL
Server
Licensing SQL Server on Azure Virtual Machines

• SQL Server images from the Azure Virtual


Machine Gallery include a license to run SQL
Server in the per-minute rate
• Microsoft customers can use license mobility to
add a SQL Server license to their own images
• Microsoft partners can install or upload an image
that includes an SAL
High Availability in Azure Virtual Machines

• Highly available SQL Server architectures in


Azure:
• Always On Availability Groups
• Always On Failover Cluster Instances

• Availability Groups reduce downtime by placing


virtual machines in different:
• Fault domains
• Update domains
Disaster Recovery in Azure Virtual Machines

• Disaster recovery solutions:


• Always On Availability Groups across multiple Azure
regions
• Database mirroring
• Backup and Restore by using the Azure Blob storage
service
• Using the SQL Server IaaS Agent Extension to
automate backups
Automated Patching for SQL Server in Azure
Virtual Machines

• Automated Patching creates a schedule of times


during which updates may be installed
• It requires the SQL Server IaaS Agent Extension
• Configure the schedule in the portal or in Azure
PowerShell:

$vmname = "MyVM"
$resourcegroupname = "MyResourceGroup"
$Schedule =
AzureRM.Compute\New-AzureVMSqlServerAutoPatchingConfig
-Enable -DayOfWeek "Sunday"
-MaintenanceWindowStartingHour 3
-MaintenanceWindowDuration 120 -PatchCategory "Important"
Set-AzureRmVMSqlServerExtension -AutoPatchingSettings $Schedule
-VMName $vmname -ResourceGroupName $resourcegroupname
Lesson 2: Migrating a Database to a Microsoft
Azure Virtual Machine

• Choosing a Migration Method


• Using Backup and Restore for Migration
• The Deploy Database to a Microsoft Azure VM
Wizard
• Demonstration: Migrating a Database to an Azure
Virtual Machine
Choosing a Migration Method

• Migration methods that include downtime:


• Backup and restore with compression
• Backup to an Azure Blob storage account
• Detach and copy the database files to Azure Blob
storage
• Convert the server to a VHD and deploy it as an Azure
virtual machine
• Ship a hard disk to an Azure physical location

• Migration methods that minimize downtime:


• Add an Always On replica on an Azure virtual machine
• Use SQL Server transactional replication
Using Backup and Restore for Migration

• Backing up to an on-premises location:


1. Back up the database by using compression:

USE AdventureWorks;
GO
BACKUP DATABASE AdventureWorks
TO DISK = 'D:\Backups\AdventureWorks.Bak'
WITH COMPRESSION, FORMAT,
MEDIANAME = 'MigrationBackups',
NAME = 'Full Backup of AdventureWorks';
GO

2. Copy the database to the Azure virtual machine


3. Restore the database on the Azure virtual machine
• Backing up to an Azure Blob storage account
The Deploy Database to a Microsoft Azure VM
Wizard

• A wizard in SQL Server Management Studio that


automatically:
1. Creates a compressed backup file in an on-premises
location
2. Uploads the backup file to Azure
3. Restores the backup file to a new database in an
Azure virtual machine
• Create a new virtual machine or use an existing
virtual machine with SQL Server
Demonstration: Migrating a Database to an
Azure Virtual Machine

In this demonstration, you will see how to:


• Back up a database in an on-premises instance of
SQL Server
• Copy the backup file to an Azure virtual machine
• Restore the backup on the Azure virtual machine
to complete the migration
Lab: Deploying SQL Server on an Azure Virtual
Machine

• Exercise 1: Provision an Azure Virtual Machine


• Exercise 2: Migrate a Database to a Microsoft
Azure Virtual Machine
• Exercise 3: Configure SQL Server Connections

Logon Information
Virtual machine: 20765C-MIA-SQL
User name: ADVENTUREWORKS\Student
Password: Pa55w.rd

Estimated Time: 45 minutes


Lab Scenario

You have an on-premises database that you want


to migrate into the cloud. To minimize the number
of compatibility issues that will need correcting,
you have decided to host the migrated database
on a Microsoft® Azure® virtual machine that runs
Microsoft SQL Server® 2017. You have been asked
to create the virtual machine and migrate the
database by using compressed backups. After the
database has been migrated, you will connect to it
and run a query.
Lab Review

• After you created the backup file, the on-premises


server remained available for clients to connect to
and modify data. What would happen to these
modifications after you had moved clients to the
new database?
Module Review and Takeaways

• Review Question(s)

Vous aimerez peut-être aussi