Reader small image

You're reading from  Professional Azure SQL Database Administration

Product typeBook
Published inJul 2018
Reading LevelBeginner
PublisherPackt
ISBN-139781789538854
Edition1st Edition
Languages
Tools
Right arrow
Author (1)
Ahmad Osama
Ahmad Osama
author image
Ahmad Osama

Ahmad Osama works for Pitney Bowes Pvt. Ltd. as a technical architect and is a former Microsoft Data Platform MVP. In his day job, he works on developing and maintaining high performant, on-premises and cloud SQL Server OLTP environments as well as deployment and automating tasks using PowerShell. When not working, Ahmad blogs at DataPlatformLabs and can be found glued to his Xbox.
Read more about Ahmad Osama

Right arrow

Chapter 2. Migrating a SQL Server Database to an Azure SQL Database

Migrating an on-premises SQL Server Database is an important task and should be planned to perfection. An ideal migration methodology should be as shown in the following diagram:

Figure 2.1: Migration Methodology

By the end of this chapter, you will be able to:

  • Select a service tier for your migrated Azure SQL Database based on your needs

  • Explain Database Transaction Units

  • Identify and fix SQL Server to Azure SQL Database compatibility issues

  • Migrate from on-premises database to Azure SQL Database using different tools

Finding the Migration Benefits


You should first analyze and find out the benefits of migrating an on-premises SQL Database to an Azure SQL Database. Migration involves a lot of time, effort, and cost, and it shouldn't be done just for the sake of having a cloud database.

Finding the Blockers


The next step is to find out the compatibility issues which may stop you from migrating to Azure SQL Database.

Selecting a Service Model


The next step is to find out whether the database will be deployed individually or whether it will be part of an Elastic Pool. This is important as the service model will affect the overall pricing, service tier, performance, and management of the Azure SQL Database.

Selecting a Service Tier


The next step is to find an appropriate service tier and performance level for Azure SQL Database. This is important as it will directly affect the performance of an Azure SQL Database. A lower service tier will result in bad performance, and a higher service tier will result in higher cost.

Selecting the Main and Disaster Recovery Region


The next step is to find the main region and the disaster recovery region for your Azure SQL Database. It's advisable to have the database in a region that would provide fast connectivity to your users.

Selecting a Migration Tool


Microsoft provides various tools to automate database migration. You can also write PowerShell or C# script to automate the database migration process. Tool selection largely depends on the database's size and the downtime SLA.

Azure SQL Database Service Tiers


Azure SQL Database has four different service tiers which define the size, performance, features, and, most importantly, the cost of an Azure SQL Database. These service tiers are Basic, Standard, Premium, and Premium RS:

Note

The Database Transaction Unit is the measure of Azure SQL Database Performance. This is discussed later in the chapter.

Basic Service Tier

The Basic tier is the lowest tier available and is applicable to small, infrequently used applications, usually supporting one single active transaction at any given point in time.

The Basic tier has a size limit of 2 GB, a performance of 5 DTU, and costs $5/month:

Standard Service Tier

This is the most commonly used service tier and is best for web applications or workgroups with low to medium I/O performance requirements. Unlike the Basic service tier, it has four different performance levels: S0, S1, S2, and S3. Each performance level offers the same size (250 GB), however, they differ in terms...

Determining an Appropriate Service Tier


As a SQL Server DBA, when migrating to an Azure SQL Database, you will need to have an initial estimate of DTUs so as to assign an appropriate Service tier to an Azure SQL Database. An appropriate Service Tier will ensure that you met most of your application performance goals. Estimating a lower or a higher Service tier will result in decreased performance or increased cost, respectively.

This chapter teaches you how to use the DTU calculator to make an appropriate initial estimate of the Service tier. You can, at any time, change your service tier by monitoring the Azure SQL Database performance once it's up and running.

Azure SQL Database DTU Calculator

Developed by Justin Henriksen, an Azure Solution Architect at Microsoft, the DTU Calculator can be used to find out the initial Service tier for an Azure SQL Database. The calculator is available at https://dtucalculator.azurewebsites.net.

DTU Calculator Work Flow

The DTU Calculator works as shown...

Determining Compatibility Issues


Once you have finalized the Service tier, the next step is to migrate both schema and data from the on-premises SQL Database to the Azure SQL Database. As we learned in Chapter 1 Microsoft Azure SQL Database Primer, not all features are the same and supported on the Azure SQL Server. Therefore, you will first have to do a compatibility test or assessment to find and fix the compatibility issues.

The following are the available tools to detect compatibility issues. However, these tools can be used to migrate the database as well; in this section, though, we'll talk about assessing compatibility.

Data Migration Assistant

Data Migration Assistant (DMA) is a standalone tool for detecting compatibility issues and to migrate on-premises SQL Server Databases to Azure SQL Databases. It provides a wizard-type easy-to-use graphical user interface for compatibility assessment and migration.

It detects and highlights compatibility issues. Once all of the compatibility...

Determining the Migration Method


Once you find and fix compatibility issues, the next step is to select a migration tool or method and perform the actual migration. There are different methods available for various scenarios. The selection largely depends on downtime, database size, and network speed/quality.

Here's a comparison of various migration methods to help you correctly choose a migration method:

Summary


Migrating to an Azure SQL Database is an important task and should be planned to perfection. This chapter talked about a migration strategy that you should follow when migrating from an on-premises database to an Azure SQL Database:

  1. Find the migration benefits.

  2. Find the blockers.

  3. Select a service model.

  4. Select a service tier.

  5. Select the main and disaster recovery region.

  6. Select a migration tool.

This chapter also talked about how to choose a service tier and covered different migration tools to migrate the data and the schema from an On-Premies SQL Server Database to an Azure SQL Database.

lock icon
The rest of the chapter is locked
You have been reading a chapter from
Professional Azure SQL Database Administration
Published in: Jul 2018Publisher: PacktISBN-13: 9781789538854
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
undefined
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime

Author (1)

author image
Ahmad Osama

Ahmad Osama works for Pitney Bowes Pvt. Ltd. as a technical architect and is a former Microsoft Data Platform MVP. In his day job, he works on developing and maintaining high performant, on-premises and cloud SQL Server OLTP environments as well as deployment and automating tasks using PowerShell. When not working, Ahmad blogs at DataPlatformLabs and can be found glued to his Xbox.
Read more about Ahmad Osama

Migration Method

Description

Downtime

Database Size

SQL Server Management Studio – Deploy Database to Azure SQL Database

Wizard-based GUI to export on-premises database to bacpac and import the bacpac onto Azure SQL Database.

Yes (depends on database size)

Small to Medium databases

Sqlpackage.exe

Command-line utility to export on-premises databases to bacpac and import the bacpac on to Azure SQL Database.

Yes (Depends on database size)

Small to Medium databases

Manual (Dacpac and BCP)

Use sqlpackage.exe to export dacpac (only schema) and bcp out data in a folder...