The document discusses considerations for migrating databases to Microsoft Azure SQL Database. It covers cloud options like Infrastructure as a Service (IaaS) using SQL Server on Azure VMs and Platform as a Service (PaaS) options like Azure SQL Database. It also discusses analyzing database compatibility, different migration methods like using BACPAC files or the Data Migration Assistant, and ways to optimize the migration process like monitoring tempdb usage.
7. e
#cloudconferenceitalia
IaaS – SQL Server on Azure VM
Features
• Infrastructure as a Service
• Hardware and Hypervisor maintained by
Microsoft
• SQL Server license included
• BYOL
• Pay per-minute
• Pay for premium storage (SSD: P10, P20,
P30)
Suitable for:
• Lift and Shift migrations with minimal
changes
• Resources to maintain the VM and SQL
instance
• Admin rights needed
• Customizable HA/DR
9. e
#cloudconferenceitalia
PaaS –Azure SQL Database
Features
• Platform as a Service /
Database as a Service
• Hardware, OS and SQL Server maintained
by Microsoft
• Automated backups
• Built-in HA/DR (geo-redundancy)
• Pay per hour, per service tier and
performance level
• Pay for data transfer
Suitable for:
• New applications
• SaaS app providers
• Up to 4TB databases
• Scale-out options
• Single database / non OS dependent
applications
10. e
#cloudconferenceitalia
PaaS –Azure Managed Instance
Features
• Platform as a Service
• Hardware, OS and SQL Server maintained
by Microsoft
• Automated backups
• Built-in HA/DR (geo-redundancy)
Suitable for:
• Lift and shift migrations
• Applications that need instance-level
features
• Cross-database queries
• SQL Agent
• SQLCLR
• Not yet released – private preview
11. e
#cloudconferenceitalia
• Represents relative power (resources) assigned to a
database
• CPU
• Memory
• I/O
• Not an absolute unit measure
• Useful for comparison between tiers and
performance levels
• Represents resources, not performance
• DTU Calculator can help estimate the needs
PaaS - DTUs : Database Transaction Units
13. e
#cloudconferenceitalia
Basic Service Tier
PERFORMANCELEVEL BASIC
Max DTUs 5
Max database size 2 GB
Max in-memory OLTPstorage N/A
Max concurrent workers(requests) 30
Max concurrent logins 30
Max concurrent sessions 300
Suitable for:
• Applications that hit the database very
infrequently
• Tiny databases
14. e
#cloudconferenceitalia
PERFORMANCELEVEL S0 S1 S2 S3
Max DTUs 10 20 50 100
Max database size 250 GB 250 GB 250 GB 250 GB
Max in-memory OLTPstorage N/A N/A N/A N/A
Max concurrent workers(requests) 60 90 120 200
Max concurrent logins 60 90 120 200
Max concurrent sessions 600 900 1200 2400
Standard Service Tier
Suitable for:
• Applications with limited performance requirements
• Mid-sized databases
15. e
#cloudconferenceitalia
Premium Service Tier
Suitable for:
• Applications with high performance requirements
• Large databases
PERFORMANCELEVEL P1 P2 P4 P6 P11 P15
Max DTUs 125 250 500 1000 1750 4000
Max database size 500 GB 500 GB 500 GB 500 GB 4 TB 4 TB
Max in-memory OLTPstorage 1GB 2 GB 4 GB 8 GB 14 GB 32 GB
Max concurrent workers(requests) 200 400 800 1600 2400 6400
Max concurrent logins 200 400 800 1600 2400 6400
Max concurrent sessions 30000 30000 30000 30000 30000 30000
16. e
#cloudconferenceitalia
Premium RS Service Tier
Suitable for:
• Applications with high I/O demands, but not the
highest availability guarantees
• ETL, demos, reconstructable data
PERFORMANCELEVEL PRS1 PRS2 PRS4 PRS6
Max DTUs 125 250 500 1000
Max database size 500 GB 500 GB 500 GB 500 GB
Max in-memory OLTPstorage 1GB 2 GB 4 GB 8 GB
Max concurrent workers(requests) 200 400 800 1600
Max concurrent logins 200 400 800 1600
Max concurrent sessions 30000 30000 30000 30000
17. e
#cloudconferenceitalia
Features in Service Tiers
FEATURE BASIC STANDARD PREMIUM PREMIUM RS
Backup retention 7 days 35 days 35 days 35 days
Active geo-replication Supported Supported Supported Supported
Number of local replicas 3 3 3 2
In-memory OLTP - - From 1to 32 GB From 1to 8 GB
Columnstore Indexes - - Supported Supported
20. e
#cloudconferenceitalia
Azure SQL Database limitations
• Connectivity and authentication
• No Windows Authentication (Azure AD is supported, with limitations)
• TCP/IP on port 1433 only
• SQL Server Agent / Jobs
• No SQL Server Agent jobs (on-premises only)
• Elastic jobs can replace SQL Server Agent
• Collation Support
• Fixed Collation (default SQL_Latin1_General_CP1_CI_AS)
• Naming Requirements
• Restricted usernames (admin, administrator, guest, root, sa, ‘’)
• Queries
• No cross-database queries
• No references to system databases or instance-level features
22. e
#cloudconferenceitalia
.
• Create New Project
• Import application-scoped
objects only
• Start the import
• Target Platform to Microsoft
Azure SQL Database V12
• Build
• Error List
Check compatibility with SSDT
23. e
#cloudconferenceitalia
• Open a command prompt and change a directory containing sqlpackage.exe
• Execute the following SqlPackage command
• Open the output file and review the compatibility errors
Check compatibility with SQLPACKAGE
24. e
#cloudconferenceitalia
Check Compatibility with SSMS
• Open the latest version of SSMS
and connect to your database
• Export Data-tier Application
• Save to a BACPAC file
• Skip exporting data
• Compatibility issues appear – click
on error
25. e
#cloudconferenceitalia
Check Compatibility with DMA
.
• Download and open Data Migration
Assistant (DMA)
• Create a new Assessment Project
with Azure SQL Database Target
• Connect to local instance
• Select the source database(s)
• Verify Compatibility Report
27. e
#cloudconferenceitalia
• Compatibility issues must be fixed before proceeding with the SQL Server Database
migration.
• A wide variety of compatibility issues
• Use the following resources
• SQL Server database features not supported in Azure SQL Database
• Discontinued Database Engine Functionality in SQL Server 2016
• Discontinued Database Engine Functionality in SQL Server 2014
• Discontinued Database Engine Functionality in SQL Server 2012
• Discontinued Database Engine Functionality in SQL Server 2008 R2
Fix Database Migration Compatibility Issues
29. e
#cloudconferenceitalia
• SSMS migration wizard
• Export / Import with BACPAC
• SSMS
• Azure Portal
• Powershell
• SQLPACKAGE
• Export / Import with BACPAC + BCP
• Data Migration Assistant
• Transactional Replication
Migration methods
30. e
#cloudconferenceitalia
SSMS Migration Wizard
• Deploy Database to Microsoft
Azure SQL Database
• Connect to your Azure SQL
Database Server
• Specify Azure Database Settings
• Complete the Wizard
32. e
#cloudconferenceitalia
Export/Import with BACPAC File
• Export Data-Tier Application
• Save to local or Azure Storage
• Connect to your Azure SQL Database
server
• Import Data-tier Application
• Import from local disk or Azure Storage
• Specify Database Settings
33. e
#cloudconferenceitalia
Export/Import with BACPAC File and BCP
Used for much larger databases to
achieve greater parallelization for
increases performance
Migrate the schema and the data
separately
• Export the schema only to a BACPAC file.
• Import the schema only from the BACPAC
File into SQL Database.
• Use BCP to extract the data into flat files
and then parallel load these files into Azure
SQL Database.
35. e
#cloudconferenceitalia
Data Migration Assistant
• Create a new migration project
• Select the source server
• Select the target – your Azure Logical
Server
• Select the objects to migrate
• Script & deploy schema
• Specify Database Settings
37. e
#cloudconferenceitalia
Transactional Replication
• Used to have minimal downtime during
migration
• Configure your Azure SQL Database as a
subscriber
• All changes to your data or schema show
up in your Azure SQL Database
• Synchronization is complete – change
connection string of your application
• Remove Replication
39. e
#cloudconferenceitalia
• Use a high database performance level
• Use SqlPackage
• Disable the indexes and constraints
• Disable auto-statistics
• Drop indexed views, recreate once finished
• Do not migrate unnecessary data
• Fire multiple simultaneous bcp executions
Speed up the import process
40. e
#cloudconferenceitalia
• If you use BACPACs, create your storage account in the same region as your Azure SQL
Database
• BACPAC files must be saved to standard Azure Blob Storage, not premium storage
• Create an empty database in advance
• Make sure you have enough CPU capacity for BACPAC compression
• Use AZCopy to copy your BACPAC faster
Useful tips!
41. e
#cloudconferenceitalia
• Performance levels have different TEMPDB capacities
• Most impacting – Read-Committed Snapshot Isolation (RCSI)
• Monitor tempdb usage
Monitor your tempdb space
42. e
#cloudconferenceitalia
• Performance levels have different Transaction Log capacities
• Recovery model full (it is not possible to change it)
• Avoid long running transactions (use –b option)
• Review the transaction log usage
• Transaction Log Backup are done by Azure SQL Platform every 5 mins
Monitor your Transaction Log
43. e
#cloudconferenceitalia
Summary
• For smaller databases, web-based applications, and specifically new
development, Azure SQL Database may be appropriate
• SQL Server 2016 on Azure VM may be more appropriate for existing
applications, and more cost-effective for larger databases, even with an
Enterprise license
• Some important on-premises features are not available in Azure SQL
Database
• Tools can help you identify incompatible features
• Tools can help you in the migration process