Migrating to Azure SQL Database



Similar documents
Exploring AlwaysOn Failover Cluster Instances

Exploring Organizational Security and Auditing

Building an ASP.NET MVC Application Using Azure DocumentDB

Exploring Manual and Automatic Database Backup Using Microsoft Azure Storage

Exploring SQL Server Data Tools in Visual Studio 2013

Exploring SQL Server 2014 Database Deployment in Microsoft Azure Virtual Machines

Guide to Setting up Docs2Manage using Cloud Services

System Administration Training Guide. S100 Installation and Site Management

Interworks. Interworks Cloud Platform Installation Guide

NetIQ. How to guides: AppManager v7.04 Initial Setup for a trial. Haf Saba Attachmate NetIQ. Prepared by. Haf Saba. Senior Technical Consultant

Exploring In-Memory OLTP

ICONICS Using the Azure Cloud Connector

SolarWinds Migrating SolarWinds NPM Technical Reference

How To Create An Easybelle History Database On A Microsoft Powerbook (Windows)

Omniquad Exchange Archiving

ADC Windows 7 Professional

Dell Statistica Statistica Enterprise Installation Instructions

Scribe Online Integration Services (IS) Tutorial

formerly Help Desk Authority Upgrade Guide

HOW TO SILENTLY INSTALL CLOUD LINK REMOTELY WITHOUT SUPERVISION

Dell Statistica Document Management System (SDMS) Installation Instructions

MacroLan Azure cloud tutorial.

TSM Studio Server User Guide

Getting Started with the Ed-Fi ODS and Ed-Fi ODS API

QUANTIFY INSTALLATION GUIDE

Table of Contents SQL Server Option

MATLAB Distributed Computing Server with HPC Cluster in Microsoft Azure

Lab 1: Windows Azure Virtual Machines

Bitrix Site Manager ASP.NET. Installation Guide

Lab 00: Configuring the Microsoft Lync Ignite Environment Cloud Hosted Version

Team Foundation Server 2012 Installation Guide

Setting Up ALERE with Client/Server Data

Installation / Backup \ Restore of a Coffalyser.Net server database using SQL management studio

Windows Azure Pack Installation and Initial Configuration

Universal Management Service 2015

GP REPORTS VIEWER USER GUIDE

Hands on Lab: Building a Virtual Machine and Uploading VM Images to the Cloud using Windows Azure Infrastructure Services

Install MS SQL Server 2012 Express Edition

Cloud Identity Management Tool Quick Start Guide

VERITAS Backup Exec TM 10.0 for Windows Servers

Keynote DeviceAnywhere/HP Application Lifecycle Management (HP ALM/QC) Integration Guide. TCE Automation 5.2

Deploying System Center 2012 R2 Configuration Manager

BIGPOND ONLINE STORAGE USER GUIDE Issue August 2005

Getting Started with Attunity CloudBeam for Azure SQL Data Warehouse BYOL

About Recovery Manager for Active

Installing LearningBay Enterprise Part 2

How To Configure A Windows 8.1 On A Windows (Windows) With A Powerpoint (Windows 8) On A Blackberry) On An Ipad Or Ipad (Windows 7) On Your Blackberry Or Black

Symantec Backup Exec TM 11d for Windows Servers. Quick Installation Guide

Verizon Cloud Desktop Application Help Guide Version

MobiLink Synchronization with Microsoft SQL Server and Adaptive Server Anywhere in 30 Minutes

Moving the TRITON Reporting Databases

Server Installation Guide ZENworks Patch Management 6.4 SP2

Gómez Script Recorder

Getting Started with Elastic DB Database Tools with Azure SQL

Mechanics Bank Mobile Banking Mobile Finance Manager (MFM) Application Windows Mobile Phone Installation

Upgrade Guide BES12. Version 12.1

Contents Notice to Users

How to recover IE Client

Note: With v3.2, the DocuSign Fetch application was renamed DocuSign Retrieve.

AppLoader 7.7. Load Testing On Windows Azure

IIS, FTP Server and Windows

TECHNICAL NOTE. The following information is provided as a service to our users, customers, and distributors.

Acronis Backup & Recovery 11.5 Quick Start Guide

TSM for Windows Installation Instructions: Download the latest TSM Client Using the following link:

Microsoft SQL Replication

Master Data Services. SQL Server 2012 Books Online

First Time On-Campus VLab Setup Windows XP Edition

Idera SQL Diagnostic Manager Management Pack Guide for System Center Operations Manager. Install Guide. Idera Inc., Published: April 2013

Check current version of Remote Desktop Connection for Mac.. Page 2. Remove Old Version Remote Desktop Connection..Page 8

TM Online Storage: StorageSync

SHAREPOINT 2013 IN INFRASTRUCTURE AS A SERVICE

Reporting works by connecting reporting tools directly to the database and retrieving stored information from the database.

CaseWare Time. CaseWare Cloud Integration Guide. For Time 2015 and CaseWare Cloud

Nexio Connectus with Nexio G-Scribe

STEP BY STEP IIS, DotNET and SQL-Server Installation for an ARAS Innovator9x Test System

Sage HRMS 2014 Sage Employee Self Service Tech Installation Guide for Windows 2003, 2008, and October 2013

Secure Website and Reader Application User Guide

Team Foundation Server 2010, Visual Studio Ultimate 2010, Team Build 2010, & Lab Management Beta 2 Installation Guide

Copyright. Disclaimer. Introduction 1. System Requirements Installing the software 4

14.1. bs^ir^qfkd=obcib`qflk= Ñçê=emI=rkfuI=~åÇ=léÉåsjp=eçëíë

Implementing Microsoft SQL Server 2008 Exercise Guide. Database by Design

Project management integrated into Outlook

Linking Access to SQL Server

Utilities ComCash

NovaBACKUP xsp Version 15.0 Upgrade Guide

Silect Software s MP Author

LifeCyclePlus Version 1

Sitecore Ecommerce Enterprise Edition Installation Guide Installation guide for administrators and developers

StarWind iscsi SAN Software: Installing StarWind on Windows Server 2008 R2 Server Core

WINDOWS 7 & HOMEGROUP

BID2WIN Workshop. Advanced Report Writing

Quick Start Guide for VMware and Windows 7

Dell InTrust Preparing for Auditing Microsoft SQL Server

Archiving User Guide Outlook Plugin. Manual version 3.1

Active Directory Reporter Quick start Guide

Enterprise Self Service Quick start Guide

InfoPrint 4247 Serial Matrix Printers. Remote Printer Management Utility For InfoPrint Serial Matrix Printers

Monetra Payment Software

NSi Mobile Installation Guide. Version 6.2

Remote Console Installation & Setup Guide. November 2009

Transcription:

Migrating to Azure SQL Database

Contents Azure account required for lab... 3 SQL Azure Migration Wizard Overview... 3 Provisioning an Azure SQL Database... 4 Exercise 1: Analyze and resolve... 8 Exercise 2: Create an Azure SQL Database and Migrate... 15 Roll back Azure changes... 27 Terms of use... 29 Introduction to Azure SQL Database Service Tiers

Azure account required for lab Estimated time to complete lab is 40-45 minutes. This lab provides an overview of SQL Azure Migration Wizard (SQLAzureMW) and walks you through migrating the Northwind database on a SQL Server 2005 Express database instance to Azure SQL Database. When migrating from an on-premises SQL Server, there are a compatibility issues you need to consider. Azure SQL Database is constantly being upgraded to run on the latest SQL Server version. In addition there might be feature level compatibility that might affect your database. While carrying all of the exercises within this hands on lab you will either be making use of the Azure portal at https://manage.windowsazure.com/ or the Preview portal at https://portal.azure.com/. To perform this lab, you will require a Microsoft Azure account. If you do not have an Azure account, you can request a free trial version by going to http://azure.microsoft.com/en-us/pricing/freetrial/. Within the one-month trial version, you can perform other SQL Server 2014 hands on labs along with other tutorials available on Azure. Note, to sign up for a free trial, you will need a mobile device that can receive text messages and a valid credit card. Be sure to follow the Roll back Azure changes section at the end of this exercise after creating the Azure database so that you can make the most use of your $200 free Azure credit. SQL Azure Migration Wizard Overview SQLAzureMW is a tool that will help you migrate your SQL Server 2005 (or later) database to Azure SQL Database. It looks for patterns that have been identified as incompatible and flags incompatibility issues and fixes them when possible. Also note that SQLAzureMW uses Regex and does a pattern search. It is not a full TSQL parser and can thus miss something or report something that is invalid when it is not. For example: if you have a variable declared in a stored procedure named @rowguid, SQLAzureMW would find rowguid and report that it is not supported. While that is true, the use of as a variable name is not. So, when you look through the analysis, be sure to look at the warning and validate that the TSQL flagged. If it looks ok to you, then ignore the warning and let it run against Azure SQL DB. Introduction to Azure SQL Database Service Tiers 3

You can run the Migration Wizard either from the same machine as your SQL Server database you want to migrate or run from a different machine and point to the database you want to migrate to. The version of SQL Server that you run the migration under does not have to be the same as your source database that you want to migrate. When using the migration wizard, you will find that the best migration experience for migrating to Azure SQL Database is migrating from a SQL Server 2008 R2 (or later) compatible database. This means that if you want to migrate your SQL Server 2005 database to Azure SQL Database, run the migration wizard from a SQL Server 2008R2 installation or later. If you don t have a SQL Server 2008 R2 or later, you can either download the trial version SQL Server 2014, or install the SQL Server 2008 R2 feature pack on a machine and run the Migration Wizard from that machine. This lab uses SQL Server 2014 and SQLAzureMW version 5.11 downloaded from http://sqlazuremw.codeplex.com/. Provisioning an Azure SQL Database In this section, you will create the target Azure SQL Databaase using your Azure account. Setting up your desktop Note, if you have a monitor that supports a larger screen resolution than 1024 x 768, you can change the screen resolution for the lab to go as high as 1920 x 1080. By going to a higher screen resolution, it will be easier to use SQL Server Management Studio. 1. Right click on the desktop and click on Screen resolution. 2. Select 1152 x 864 (a good minimum screen size for using SSMS) and click OK. 3. Click Keep Changes. 4. Resize the client hollaunchpad Online window for the lab to fit your screen resolution. Setup a Microsoft Azure SQL Database 1. Login to the Azure portal at https://manage.windowsazure.com/ with your Azure subscription credentials 2. Click on New and select Data Services, SQL Database, Custom Create Introduction to Azure SQL Database Service Tiers 4

3. When the new SQL database dialog is visible fill in the details as below and click the right arrow icon a. Name : NorthwindHOL b. Subscription : Select the subscription to create the databases against c. Service Tier : Basic d. Performance Level : Basic (5 DTUs) e. MaxSize : 100 MB f. Collation : Leave as default g. Server : New SQL database server The service tiers define the performance characteristics of the database. Introduction to Azure SQL Database Service Tiers 5

Basic: Best suited for a small size database, supporting typically one single active operation at a given time. Examples include databases used for development or testing, or small scale infrequently used applications. Standard: The go-to option for most cloud applications, supporting multiple concurrent queries. Examples include workgroup or web applications. Premium: Designed for high transactional volume, supporting a large number of concurrent users and requiring the highest level of business continuity capabilities. Examples are databases supporting mission critical applications. 4. Type in the following fields and then click on the tick icon a. Login name : northwind_sa b. password : Pass@word12 c. Region : West US This may take some time while the database is created, while you wait you will get some feedback from the notification bar. Introduction to Azure SQL Database Service Tiers 6

5. Select the SQL Database tab on the left hand side and look for the database which is being created Record the server name the database has been created on in your temporary notepad (example highlighted above). You will need this in a moment to configure the firewall and access the database. Configure firewall for SQL Database server You will now need to allow access to the database server from your ip address. 1. Select the Servers tab in the header 2. Select the name of the server which you want to configure access to. In this image the name of the server is s6eugkmkhn but will vary based on your server 3. Select the configure tab in the header Introduction to Azure SQL Database Service Tiers 7

4. Click on the right arrow icon To help protect your data, the SQL Database firewall prevents all access to your database server until you specify which computers have permission. The firewall grants access based on the IP address of each request. 5. Click Save in the footer Congratulations, you now have an empty NorthwindHOL database which will be used for rest of this hands on lab. Exercise 1: Analyze and resolve In this exercise, you will run the migration wizard and analyze a SQL Server 2005 database from the local SQL Server Instance, for its readiness to migrate to Azure SQL database. 1. Go to the desktop for the server and double click on the SQLAzureMW Shortcut 2. When you start the migration wizard, you will see four selections. Select Database option under Analyze/Migrate. Introduction to Azure SQL Database Service Tiers 8

3. Click Next. 4. SQLAzureMW prompts you to connect your local server or one on another server. For the Server name, use localhost\sqlexpress to connect to the SQL Server 2005 instance. Introduction to Azure SQL Database Service Tiers 9

5. Click Connect to continue. 6. SQLAzureMW displays the list of available databases. Click on [Northwind] and click Next. Introduction to Azure SQL Database Service Tiers 10

7. By default, all of the objects are selected for scripting. Click on Next to continue. Note: You will notice that this menu has an Advanced button. Select this option if you want to modify any of the scripting options (like scripting your data). A dialog box will be displayed giving a list of scripting options. You can modify database scripting options by selecting from the available settings in the list box to the right of each option. The options are applied globally to the objects that are being scripted. Introduction to Azure SQL Database Service Tiers 11

8. Click Next for the Script Wizard Summary page. Introduction to Azure SQL Database Service Tiers 12

9. When the Generate Script message box pops up, click Yes to generate the SQL script for the selected objects. SQLAzureMW will then generate the script for the selected objects. The Results Summary window will have two tabs. The first tab, Result Summary shows the messages and results of the script generation. Some of the compatibility issues will be automatically resolved by the tool. Marked in Red in the window. Introduction to Azure SQL Database Service Tiers 13

The second tab SQL Script shows the actual generated SQL script for migration. Along with the generated TSQL, SQLAzureMW will display commented messages starting with --~. These comments are for user s information so that they can see where automatic changes occurred against your objects without having to switch back to the Result Summary tab. Scroll through the script window, highlighting the changes done by the tool to resolve some of the compatibility issues (marked in red color). This lab has couple of types of changes done automatically by the migration wizard. These changes are done in the generated SQL script and also the corresponding message is output in the Result Summary tab (see figure below -these changes are marked in red color) Azure SQL DB requires that a table has a clustered index. Migration Wizard will evaluate each table scripted for a clustered index and if it does not find one, it will generate a clustered index for you. Table hints in Azure SQL DB need a keyword WITH. This will be added to the generated SQL Script. Optionally, you can press Save in each of these tabs to save the contents to disk. Introduction to Azure SQL Database Service Tiers 14

10. Hit Next button to proceed with exercise 2 below. Exercise 2: Create an Azure SQL Database and Migrate In this step, the wizard will create populate the onjects in the NorthwindHOL database you created earlier and upload the data. Connect to Azure SQL Database 1. In the Setup Target Server Connection dialog, select Connect to Server button. Introduction to Azure SQL Database Service Tiers 15

2. In the Connect to Server pop up dialog, enter your target server connection information. Introduction to Azure SQL Database Service Tiers 16

3. Note that the Connect to Server dialog screen will present you with an example Azure SQL DB server name. You will need to get your Azure SQL DB server name from your Azure portal and also enter your login information: Login: northwind_sa@server Password: Pass@word12 Introduction to Azure SQL Database Service Tiers 17

4. Select Connect to connect to the Azure server. 5. In the Setup Target Server Connection dialog you will see all the existing databases in your Azure SQL DB Server. Introduction to Azure SQL Database Service Tiers 18

Note: The Create Database button allows you to create a new Azure SQL Database on the target server if you happened to choose an existing server. The wizard displays a dialog that allows you to specify the same parameters you use when creating a database on Azure as shown below. Introduction to Azure SQL Database Service Tiers 19

You will use the existing NorthwindHOL database created in the first exercise. Introduction to Azure SQL Database Service Tiers 20

6. Select the [NorthwindHOL] database in the dialog and click Next. 7. Click Yes to execute the script to add the source objects and data to your Azure SQL Database. 8. The wizard shows the progress in the results window as each object is processed. Introduction to Azure SQL Database Service Tiers 21

9. When the wizard completes, you can click the Exit button. Introduction to Azure SQL Database Service Tiers 22

Verifying the result with SQL Server Management Studio 1. Click on the SSMS toolbar button on the task bar to launch Management Studio. 2. In the Connect to Server dialog, enter in the following: Server name: <your server>.database.windows.net Authetication: SQL Server Authentication Login: northwind_sa@<your server> Password: Pass@word12 Introduction to Azure SQL Database Service Tiers 23

3. Click Connect to connect to the server. 4. In the Object Explorer window, expand the server, Databases, NorthwindHOL, and Tables folders to see the tables imported by the wizard. You can explore the other objects like indexes and run SQL queries to validate the result. Updating your application connection string Introduction to Azure SQL Database Service Tiers 24

For your applications, you can change the connection string to now point to the Azure SQL Database server and database. 1. Go back to the Azure portal and click on SQL DATABASES. 2. Click on your NorthwindHOL database to display the start page for the database. 3. At the bottom of the screen, click on the View SQL Database connection strings for ADO.NET, ODBC, PHP, and JDBC link. 4. You can use these strings in your application to connect to your Azure SQL Database. Introduction to Azure SQL Database Service Tiers 25

As the note at the bottom of the screen suggests, you will need to update your Azure SQL Database server firewall settings for the clients accessing the database. Azure allows you to specify a range of IP addresses for corporate environments. As you can see, migrating your SQL Server 2005 databases to an Azure SQL Database using the SQL Azure Migration Wizard is easy. More importantly, your database on Azure is fully supported by Microsoft and you can update the databse to take advantage of the features available on Azure. Introduction to Azure SQL Database Service Tiers 26

Roll back Azure changes Let s clean up the assets we have used during this hands on lab. Here are the items which should be deleted from your subscription: Delete the Azure SQL Databases 1. Select the SQL Database tab on the left hand side. 2. Click anywhere in the row of the database for the NorthwindHOL database, except within the name cell as this will navigate into the database 3. Click Delete 4. Confirm the database and the server name match the one created within this hands on lab by clicking Yes, Delete Delete the SQL Database servers You now need to delete the two database servers that were created when you created the SQL Databases. 1. Click on SERVERS within the sql databases page. Introduction to Azure SQL Database Service Tiers 27

2. Locate the Primary server you recorded in your notepad editor within the list of servers. 3. Click on the DELETE command at the bottom of the window. 4. Enter in the server name for the CONFIRM SERVER NAME and click the check mark to confirm the deletion. Introduction to Azure SQL Database Service Tiers 28

Terms of use 2014 Microsoft Corporation. All rights reserved. By using this Hands-on Lab, you agree to the following terms: The technology/functionality described in this Hands-on Lab is provided by Microsoft Corporation in a sandbox testing environment for purposes of obtaining your feedback and to provide you with a learning experience. You may only use the Hands-on Lab to evaluate such technology features and functionality and provide feedback to Microsoft. You may not use it for any other purpose. You may not modify, copy, distribute, transmit, display, perform, reproduce, publish, license, create derivative works from, transfer, or sell this Hands-on Lab or any portion thereof. COPYING OR REPRODUCTION OF THE HANDS-ON LAB (OR ANY PORTION OF IT) TO ANY OTHER SERVER OR LOCATION FOR FURTHER REPRODUCTION OR REDISTRIBUTION IS EXPRESSLY PROHIBITED. THIS HANDS-ONLAB PROVIDES CERTAIN SOFTWARE TECHNOLOGY/PRODUCT FEATURES AND FUNCTIONALITY, INCLUDING POTENTIAL NEW FEATURES AND CONCEPTS, IN A SIMULATED ENVIRONMENT WITHOUT COMPLEX SET-UP OR INSTALLATION FOR THE PURPOSE DESCRIBED ABOVE. THE TECHNOLOGY/CONCEPTS REPRESENTED IN THIS HANDS-ON LAB MAY NOT REPRESENT FULL FEATURE FUNCTIONALITY AND MAY NOT WORK THE WAY A FINAL VERSION MAY WORK. WE ALSO MAY NOT RELEASE A FINAL VERSION OF SUCH FEATURES OR CONCEPTS. YOUR EXPERIENCE WITH USING SUCH FEATURES AND FUNCITONALITY IN A PHYSICAL ENVIRONMENT MAY ALSO BE DIFFERENT. Introduction to Azure SQL Database Service Tiers 29

FEEDBACK. If you give feedback about the technology features, functionality and/or concepts described in this Hands-on Lab to Microsoft, you give to Microsoft, without charge, the right to use, share and commercialize your feedback in any way and for any purpose. You also give to third parties, without charge, any patent rights needed for their products, technologies and services to use or interface with any specific parts of a Microsoft software or service that includes the feedback. You will not give feedback that is subject to a license that requires Microsoft to license its software or documentation to third parties because we include your feedback in them. These rights survive this agreement. MICROSOFT CORPORATION HEREBY DISCLAIMS ALL WARRANTIES AND CONDITIONS WITH REGARD TO THE HANDS-ON LAB, INCLUDING ALL WARRANTIES AND CONDITIONS OF MERCHANTABILITY, WHETHER EXPRESS, IMPLIED OR STATUTORY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON- INFRINGEMENT. MICROSOFT DOES NOT MAKE ANY ASSURANCES OR REPRESENTATIONS WITH REGARD TO THE ACCURACY OF THE RESULTS, OUTPUT THAT DERIVES FROM USE OF THE VIRTUAL LAB, OR SUITABILITY OF THE INFORMATION CONTAINED IN THE VIRTUAL LAB FOR ANY PURPOSE. DISCLAIMER This lab contains only a portion of new features and enhancements in Microsoft SQL Server 2014. Some of the features might change in future releases of the product. In this lab, you will learn about some, but not all, new features. Introduction to Azure SQL Database Service Tiers 30