Migrating to Azure SQL Database Tips, Tricks and Lessons Learned

Slides:



Advertisements
Similar presentations
Low Control | Low Maintenance Shared Lower cost Dedicated Higher cost High Control | High Maintenance Hybrid On premises Off premises SQL Server Physical.
Advertisements

Managing and Monitoring SQL Server 2005 Shankar Pal Program Manager SQL Server, Redmond.
A Technical Overview of Microsoft SQL Server 2005 Melville Thomson IT Pro Evangelist (UK)
VMware vCenter Server Module 4.
XVII Encontro – 29/11/2011. Virgílio Esteves ID&T – Research & Founder of NetPonto Coimbra C# / WPF / Silverlight / XNA / Azure.
Chapter 10 : Designing a SQL Server 2005 Solution for High Availability MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design.
Maintaining a Microsoft SQL Server 2008 Database SQLServer-Training.com.

Microsoft Azure Introduction ISYS 512. Microsoft Azure Microsoft Azure is a cloud.
Microsoft Azure Virtual Machines. Networking Compute Storage Virtual Machine Operating System Applications Data & Access Runtime Provision & Manage.
Chapter 6 : Designing SQL Server Service-Level Security MCITP Administrator: Microsoft SQL Server 2005 Database Server Infrastructure Design Study Guide.
1 SQL Server 2000 Administration Kashef Mughal MSB.
Chokchai Junchey Microsoft Product Specialist Certified Technical Training Center.
1 Chapter Overview Preparing to Upgrade Performing a Version Upgrade from Microsoft SQL Server 7.0 Performing an Online Database Upgrade from SQL Server.
Module 1 Introduction to SQL Server® 2008 R2 and its Toolset.
Azure. SQL, SharePoint, BizTalk Images Distributed Cache Queue Geo Replication Read-Only Secondary Storage Delete Disks Large Memory SKU Tag Expressions.
20409A 7: Installing and Configuring System Center 2012 R2 Virtual Machine Manager Module 7 Installing and Configuring System Center 2012 R2 Virtual.
Hosting Websites and Web Applications with Microsoft ® SQL Server ® 2008.
SQL Server 2005 Implementation and Maintenance Chapter 6: Security and SQL Server 2005.
Tweak Performance and Improve Availability of your Microsoft Azure VMs Rick
#sqlsat454 October 10, 2015 Implementing and maintaining an Azure SQL Database project Emanuele thinkit.it –
Introduction to SQL Server  Working with MS SQL Server and SQL Server Management Studio.
Deploying Highly Available SQL Server in Windows Azure A Presentation and Demonstration by Microsoft Cluster MVP David Bermingham.
Rick Claus Architect like a PRO for Performance and Availability of your Microsoft Azure VMs ARC43 6.
Putting Your Head in the Cloud Working with SQL Azure David Postlethwaite 19/09/2015David Postlethwaite.
SQL Server as a Cloud Service November 11th 2015 Warner Chaves SQL MVP/MCM.
SQL Server as a Cloud Service April 15th 2016 Warner Chaves Data Platform MVP/SQL Server MCM.
Microsoft Dynamics NAV Dynamics NAV 2016 one Azure SQL Dmitry Chadayev Microsoft.
Microsoft Dynamics NAV Microsoft Dynamics NAV managed service for partners, under the hood Dmitry Chadayev Corporate Vice President, Microsoft.
Stretch Database & Managed Backups Cloud Services for your SQL Servers Andrew Loree – Solution Architect.
Azure.
SQL Database Management
Migrate DB to Azure SQL Taiob M Ali.
Managing a database environment in the cloud
Backups for Azure SQL Databases and SQL Server instances running on Azure Virtual Machines Session on backup to Azure feature (manual and managed) in SQL.
Use relational database as a service
Migrating to Azure SQL Database: Tips, Tricks, and Lessons Learned
IT06 – HAVE YOUR OWN DYNAMICS NAV TEST ENVIRONMENT IN 90 MINUTES
Get the Most out of SQL Server Standard Edition
On-premise database. Files in the cloud.
Azure SQL Databases - Introduction and Migration
Lead SQL BankofAmerica Blog: SQLHarry.com
Example of a page header
Logo here Module 3 Microsoft Azure Web App. Logo here Module Overview Introduction to App Service Overview of Web Apps Hosting Web Applications in Azure.
Windows Azure Migrating SQL Server Workloads
VIDIZMO Deployment Options
04 – Azure SQL Database Bret Stateham | Senior Technical Evangelist​
Design and Implement Cloud Data Platform Solutions
Contained DB? Did it do something wrong?
Azure.
02 | Design and implement database
Upgrading to Microsoft SQL Server 2014
By Saru Radhakrishnan Member - Sacramento SQL Server Group 07/28/2018
Implementing and maintaining an Azure SQL Database project
Introduction to Azure SQL Database
20409A 7: Installing and Configuring System Center 2012 R2 Virtual Machine Manager Module 7 Installing and Configuring System Center 2012 R2 Virtual.
Cloud BI with Azure Analysis Services
Migrating your SQL Server Instance
TechEd /23/ :44 AM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered.
Data Security for Microsoft Azure
Outline Virtualization Cloud Computing Microsoft Azure Platform
Azure SQL Database - Managing your database on the cloud
SQL Server performance tuning on Azure IaaS
AlwaysOn Availability Groups
MS AZURE By Sauras Pandey.
5 Azure Services Every .NET Developer Needs to Know
Your Data Any Place, Any Time
Disaster Recovery Done Dirt Cheap Founder Curnutt Data Solutions
06 | SQL Server and the Cloud
The Database World of Azure
Presentation transcript:

Migrating to Azure SQL Database Tips, Tricks and Lessons Learned Randolph West, Born SQL Calgary PASS Chapter, 17 August 2016 Email: r@ndolph.ca Twitter: @rabryst

Microsoft is Cloud First What’s the Difference? Azure SQL Database cloud, cloud, cloud, shiny, shiny, shiny SQL Server on-prem, earthed, traditional, legacy Microsoft is Cloud First

Azure SQL Database vs SQL Server VM Platform-as-a-Service (PaaS) Mostly compatible with SQL Server 2014 and 2016 Pay-as-you-go Scale-up or scale-out instantly* Automatically configured, patched, and upgraded Automated backups, Point-In-Time Restore, Geo-Restore, and Active Geo-Replication Pay per hour, per service tier and performance level Pay for data transfer Total cost of application = Highly minimized administration costs + software development costs + SQL Database service costs

Azure SQL Database vs SQL Server VM Infrastructure-as-a-Service (IaaS) SQL Server 2014 or 2016, installed on a virtual machine Per-minute licencing cost (Web, Standard, Enterprise) Or bring your own existing licence and only pay for Windows VM Fully customisable You are responsible for managing it (patching, maintenance, backups) Pay for premium storage (SSD drives: P10, P20, P30) Total cost of application = Minimized software development/modification costs + administration costs + SQL Server and Windows Server licensing costs + Azure Storage costs

Which One Do I Choose? Do you have to choose? Why? Are you sure? Is your company going to benefit from this?

Azure SQL Database Limitations https://azure.microsoft.com/en-us/documentation/articles/sql- database-general-limitations/ Highlights: No Windows Authentication (Azure AD is supported) TCP/IP on port 1433 only No SQL Server Agent jobs (on-premises only) Fixed Collation (default SQL_Latin1_General_CP1_CI_AS) Restricted usernames (admin, administrator, guest, root, sa, ‘\’)

Transact-SQL Differences in Azure SQL Database https://azure.microsoft.com/en-us/documentation/articles/sql- database-transact-sql-information/ “Azure SQL Database is designed to isolate features from any dependency on the master database. As a consequence many server-level activities are inappropriate for SQL Database and are unsupported.” – Microsoft

Features Not Supported Connection related: Endpoint statements, ORIGINAL_DB_NAME. Windows authentication is not available for logins or contained database users. Features that rely upon the SQL Server Agent or the MSDB database: jobs, alerts, operators, Policy-Based Management, database mail, central management servers. Serverless express: localdb, user instances Service broker SET REMOTE_PROC_TRANSACTIONS Cross database queries using three or four part names. (Read-only cross-database queries are supported by using elastic database query.) FILESTREAM SHUTDOWN Functions: fn_get_sql, fn_virtualfilestats, fn_virtualservernodes sp_addmessagesp_configure options and RECONFIGURE Cross database ownership chaining, TRUSTWORTHY setting Global temporary tables sp_helpuser Data Collector Hardware related server settings: memory, worker threads, CPU affinity, trace flags, etc. Use service levels instead. sp_migrate_user_to_contained Database Diagrams SQL Server audit (use SQL Database auditing instead) Database Mail HAS_DBACCESS DATABASEPROPERTY (use DATABASEPROPERTYEX instead) KILL STATS JOB SQL Server Profiler Linked servers, OPENQUERY, OPENROWSET, OPENDATASOURCE, BULK INSERT, 3 and 4 part names SQL Server trace EXECUTE AS logins Trace flags Encryption: extensible key management Master/target servers Transact-SQL debugging Eventing: events, event notifications, query notifications .NET Framework CLR integration with SQL Server Triggers: Server-scoped or logon triggers Features related to database file placement, size, and database files which are automatically managed by Microsoft Azure. Resource governor USE statement: To change the database context to a different database you must make a new connection to the new database. Semantic search Features that relate to high availability which is managed through your Microsoft Azure account: backup, restore, AlwaysOn, database mirroring, log shipping, recovery modes. Server credentials Sever-level items: Server roles, IS_SRVROLEMEMBER, sys.login_token. Server level permissions are not available though some are replaced by database-level permissions. Some server-level DMV's are not available though some are replaced by database-level DMVs. Features that rely upon the log reader running on SQL Database: Push Replication, Change Data Capture.

Migrating a SQL Server Database to Azure SQL Database https://azure.microsoft.com/en-us/documentation/articles/sql- database-cloud-migrate/ SQL Server Data Tools for Visual Studio (SSDT): “SSDT uses the most recent compatibility rules to detect SQL Database V12 incompatibilities. If incompatibilities are detected, you can fix detected issues directly in this tool. This is currently the recommended method to test and fix SQL Database V12 compatibility issues.” – Microsoft Other tools can also help, but are not recommended: SqlPackage, Export Data Tier application wizard (SSMS), SQL Server 2016 Upgrade Advisor, SQL Azure Migration Wizard (SAMW)

Migrating a SQL Server Database to Azure SQL Database SSMS Migration Wizard BACPAC / BCP BACPAC: JSON format containing database schema and data BCP: parallel insert

Resource Limits Source: Microsoft

Understanding DTUs Database Transaction Unit (DTU): Combination of I/O, RAM, CPU and log writes in some magical* formula Azure SQL Database benchmark overview: https://azure.microsoft.com/en-us/documentation/articles/sql- database-benchmark-overview/ DTU Calculator (3rd party product): http://dtucalculator.azurewebsites.net % Processor Time, Disk Reads/sec, Disk Writes/sec, Log Bytes Flushed/sec

Monthly Cost (CAD) Azure SQL Database (by DTUs) Basic – 5 DTU – 2GB max storage – $7 Standard S3 – 100 DTU – 250GB max storage – $219 Premium P6 – 1000 DTU – 500GB max storage – $5,428 Premium P15 – 4000 DTU – 1TB max storage – $23,350 SQL Server on Azure Windows VM (by licence / resources) DS13 instance (Web) – 8 cores – 56GB RAM – 400GB drive – $1,119 DS13 instance (Standard) – 8 cores – 56GB RAM – 400GB drive – $1,785 DS13 instance (Enterprise) – 8 cores – 56GB RAM – 400GB drive – $3,775 Additional storage – P30 SSD – 5,000 IOPS – 1TB – $164 per disk

Show Your Work Compatibility tool (SSDT) → Can I even migrate to Azure SQL Database? DTU Calculator → What service tier should I get? Do I need an elastic pool? BACPAC EXPORT → Export database schema and data BACPAC IMPORT → Insert database schema and data Azure Portal → Look at the new precious

DTU Calculator (Cry Big Ugly Tears) Important to capture over a busy period, for a long enough period. BE REALISTIC! First run of this tool, with 10 minutes of data, showed S3 ($219/mo). Second run of this tool, with an hour of data, showed P2 ($1,357/mo). Difference of $1,138 per month ($13,656 per year)

Acceptance Your boss has approved the expense, so let’s migrate!

Tips and Tricks Always use the latest version of SQL Server Management Studio BACPAC files must be saved to standard Azure Blob Storage, not premium Make sure your database is compatible with SQL Server 2016 features Watch out for hidden costs when scaling out SQL Databases, or running VMs Elastic pools can get expensive De-allocate VMs, and delete databases, if not using them

Summary DTUs do not map directly to resources, and require a workload to evaluate against (time-based evaluation). Some important on-premises features are not available in Azure SQL Database. For smaller databases, web-based applications, and specifically new development, Azure SQL Database may be appropriate. SQL Server 2016 on Azure VM is more appropriate for existing applications, and more cost-effective for larger databases, even with an Enterprise licence. YMMV (your mileage may vary).

Credits Azure website: Books Online: https://azure.microsoft.com/ https://technet.microsoft.com/en- us/library/ms130214(v=sql.130).aspx