Lynn Langit<br />lynnl@microsoft.com<br />Moving Your Data to the Cloud<br />Migrating Applications to SQL Azure<br />Sr. ...
Migrating Applications to SQL Azure<br />Overview<br />SQL Azure – now and NEW<br />App Migration <br />Data Access Tier C...
Windows Azure Platform<br />GENERAL PURPOSE PROGRAMMING LANGUAGES<br />Windows Azure Platform<br />App Fabric<br />Compute...
When Migrating Applications<br />Data Access APIs Support<br />Security Model<br />Connections  & Sizing<br />Admin and Pr...
Data Access APIs<br />Supported APIs<br />Connection String<br />ADO.Net - Encrypt=True and add @servername to User ID<br ...
Data Access APIs cont.<br />Protocols<br />Authentication Mode<br />
Connectivity & Sizing<br />Robust Connection Management through Retry Logic<br />Failover<br />HW Failures or Upgrades<br ...
Security Management<br />Manage Logins - Authentication - SQL Server (only)<br />CREATE LOGIN [testlogin] WITH PASSWORD='p...
Firewall Management<br />Portal Access<br />Programmatic Access<br />System Views and Stored Procedures - here<br />View: ...
Collations<br />Default Collation - Set to SQL_LATIN1_GENERAL_CP1_CI_AS<br />Metadata, TempDb and Default for User Data <b...
Feature Parity<br />Admin Surface – no physical administration<br />You have a master database <br />You do NOT have serve...
Migrating Applications<br />
Database Migration<br />Moving Schema and / or Data<br />Source Database types<br />SQL Server<br />MySQL<br />Access<br /...
Data Migration Tools Overview<br />Wizards<br />SQL Azure Migration Wizard (CodePlex) – here<br />Migration Assistant for ...
From SQL Server to SQL Azure<br />GUI Tools<br />SSMS for R2 > Generate Script Wizard<br />SSMS for R2 > Import / Export W...
SSMS– Generate  Script Wizard<br />Migration of schema and/or data w/ fine grain control<br />Pros - Native support for SQ...
Remove unsupported features, such as…<br />Migrating By Hand<br /><ul><li>USE DATABASE
ON PRIMARY (Filegroups)
Extended Properties
NOT FOR REPLICATION
Various Index options (WITH)
Windows logins
Unsupported XML features
Remove DEFAULT NEWSEQUENTIALID()
Encrypted Stored Procedures
No Heap tables (all tables must have clustered indices)
UDTs</li></li></ul><li>Generate Script Wizard - DEMO<br />Migrating Databases to SQL Azure<br />
SQL Azure Migration Wizard<br />http://sqlazuremw.codeplex.com<br />
What Could Go Wrong?<br />
Success!<br />
Migration Assist for MySql / Access (CTP)<br />Scenario - Auto porting of schema, database code and data from MySql and Ac...
MySQL to SQL Azure - DEMO<br />SQL Server Migration Assistant <br />Version for MySQL<br />Version for Access<br />
MySQL Migration Tool<br />
Access to SQL Azure Migration Wizard - DEMO<br />
SQL Azure - Import/Export<br />DAC v2.0 adds two new DAC services: import and exportImport and export services let you dep...
DAC (Data-tier Application) Package<br />Single unit for authoring, deploying, and managing data-tier objects (schema)<br ...
DACPAC – DEMO in SSMS<br />In SSMS<br /><ul><li>Extract
Register
Monitor w/UCPs</li></ul>In VS 2010<br /><ul><li>Import
Create</li></li></ul><li>DACPAC – DEMO in VS<br />
Transferring Large Data to SQL Azure<br />Best Practices for efficient Data movement to SQL Azure<br />Use the right tools...
BCP & Bulk Copy APIs for Large Data Transfer<br />Optimize Databases for Data Import<br />Disable/Delay creation of none C...
Import/Export Wizard – for data transfer<br />Scenario - Simplified wizard for migrating schema and data through SSIS<br /...
SSIS  Data Flow Task (Large Data Xfer)<br />Diverse Source and destinations - To/From Flat Files, ADO.Net, OleDB<br />Full...
SSIS package - DEMO<br />Use supported features only, such as bcp, but not BULK INSERT, etc…<br />
Parallelization & Network Perf<br />Latency & Bandwidth for high performance import & export<br />Latency is about laws of...
Datacenter Locations<br />
BCP Performance – test set up example<br />CREATE TABLE [dbo].[table1](<br />      [c01] [int] NOT NULL,<br />      [c02] ...
BCP Upload Perf - Rows/Sec<br />
BCP Download Perf – Rows/sec<br />
Guidance on Data Transfer to SQL Azure<br />Split data transfer into multiple concurrent streams<br />Tune BCP batch size ...
COPY Database (same or different servers)<br />CREATE DATABASE destination_database_name AS COPY OF [source_server_name.]s...
SQL Azure Data Sync <br />Elastic Scale<br />Service scales as resources requirements grow<br />No-Code Sync Configuration...
Data Sync <br />
Table Order in Sync<br />
Upcoming SlideShare
Loading in …5
×

Migrating to SQL Azure

3,095 views

Published on

Deck for screencast April 2011

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,095
On SlideShare
0
From Embeds
0
Number of Embeds
184
Actions
Shares
0
Downloads
54
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide
  • Steve Hale (Microsoft) authored this article at http://blogs.msdn.com/sqlnativeclient/archive/2010/02/12/using-sql-server-client-apis-with-sql-azure-vversion-1-0.aspxAlso updated MSDN Dev Guide &apos;How to connect&apos; http://msdn.microsoft.com/en-us/library/ee621787.aspxUsing SQL Server Client APIs with SQL Azure Version 1.0 This post describes some of the issues that the application developer should be aware of when writing ODBC, ADO.NET SQLClient, BCP, and PHP code that connects to SQL Azure. See also SQL Azure documentation on MSDN (http://msdn.microsoft.com/en-us/library/ee336279.aspx). Supported components1. Microsoft SQL Server Native Client 10.0 ODBC Driver or newer. This is a free download.2. Microsoft PHP 1.1 driver or newer. Again a free download.3. SQL Server 2008 BCP.EXE or newer. The caution here is that the queryout option is not fully supported for SQL Server 2008 RTM. Queryout is expected to be fully supported in a future release of SQL Server.4. ADO.NET 3.5 SqlClient or newer.Any other components are NOT currently supported for connecting to SQL Azure. In particular it should be noted that OLEDB connections are not currently supported from any OLEDB provider, even SQL Server 2008 Native Client OLEDB provider. ODBC connections using the on-the-box ODBC driver “SQL Server” are not currently supported.Connecting1. valid server name, user ID, and password for SQL Azure2. On the SQL Azure portal, set the firewall rules to allow your client IP address to connect to SQL Azure. Additionally, in some corporate environments, you might need to install Microsoft Firewall Client for ISA Server on the client machines or connections will not succeed. And in those environments, using IIS might require the default IIS settings for Application Pool Identity to be changed. Here is how that setting is changed: Open IIS Manager in Admin Tools, select Application Pools, Pick the pool, Advanced Setting and under Process Model change Identity from BuiltInAccount\\ApplicationPoolIdentity to Custom account domain account. Restart IIS.SQL Azure supports only TCP/IP connections using port 1433 (default for most SQL Server APIs) if other protocol choices (named pipes or using other ports) Additionally, most client APIs do not send the server name when connecting, thus the server name should be included as part of the user ID. Currently the only exception to this is .NET 4.0 which does send the server name. ODBC, BCP, PHP, and .NET 3.5 all require the server name to be sent as part of the user ID. This may change in a future release. Connection strings are all similar for each API stack and require the server name, user ID, password, and optionally the database. Trusted connections (also known as Integrated Security or Windows Authentication) are not supported. MARS is not yet supported by SQL Azure so make sure MARS is not enabled in the connection string.Creating and Connecting to a DatabaseSQLCmd example: sqlcmd -S o8uyxb64fe.ctp.database.windows.net -U &lt;MyUserID&gt;@o8uyxb64fe -P &lt;MyPassword&gt;Note the required server name (in yellow) included as part of the user ID.In the above example the database was not specified. In that case the default database “master” is used. You must connect to the master database to create databases or drop databases. Since the “USE database” command is not supported, you must disconnect after creating a database and reconnect directly to the user database. In this example we connect directly to the Northwind database.sqlcmd -S o8uyxb64fe.ctp.database.windows.net -U &lt;MyUserID&gt;@o8uyxb64fe -P &lt;MyPassword&gt; -d NorthwindCreating tablesTable creation is restricted to user databases; you cannot create tables in the master database. Table creation is substantially the same as on SQL Server, with the exception that certain data types are not supported, for example CLR User Defined Types, Filestream, and row guid types. Also, it should be mentioned that SQL Azure requires a clustered index or primary key (which uses a clustered index by default) before data can be inserted into a table. For this reason a clustered index or primary key must always be created for any table intended to contain data.Example:Create table employees(EmployeeIDint primary key, EmployeeNamevarchar(30))OrCreate table employees(EmployeeIDint, EmployeeNamevarchar(30))Create clustered index empIndex on employees(EmployeeID) Unsupported features· “USE database” is not supported· 3-part names are not supported unless the database being referenced is the current database.· Creating or dropping a database when not in the master database· Insertion of data into a table without a clustered index.· MARS connections· Trusted connections· CLR UDTs· XML schema collections· Distributed transactions (local transactions are supported)· AttachDB· Certain stored procedures, for example sp_who and undocumented stored procedures used to support OLEDB schema rowsets. Deprecated functionalitySome features are deprecated in SQL Server and should not be used in new application development. In most cases SQL Azure does not support deprecated SQL Server features. Some examples of these are:· System tables such as sysobjects, sysusers, or sysdatabases. Use the new system views instead. See http://msdn.microsoft.com/en-us/library/ms187997.aspx for a mapping to the new system views.· Numbered stored procedures· “select into” syntax· “COMPUTE BY” clause· Two-part drop index statements See http://msdn.microsoft.com/en-us/library/ee336281.aspx for more detailed Transact-SQL support.Connection behaviorSQL Azure connections will behave somewhat differently than SQL Server connections. They can be dropped for a number of reasons:· Excessive resource usage· Long-running queries· Long-running single transactions· Idle connections· Failover due to server failuresFor this reason it’s best to avoid caching connections for later use. A better strategy is to open the connection when needed, use it, and then close it. Additionally, it is recommended that applications provide retry/reconnect logic to recover from dropped connections.LatencyLatency may be a concern when using SQL Azure unless the SQL Azure server is located near the application (“code near” scenario), such as with Windows Azure and a co-located SQL Azure. Making many round trips to the server can introduce noticeable delay in an application that previously performed adequately when running against a SQL Server on the intranet. Ensure the application connects to the nearest SQL Azure server and that round trips are minimized. SUMMARYü Use only supported client components to connectü Connect using TCP/IP and port 1433ü Use SQL Authentication only, not Trusted Connections/Integrated Authentication/Windows Authentication.ü Specify the server name in the user ID.ü Ensure the firewall rules in the SQL Azure portal permit your IP address.ü Install Microsoft Firewall Client for ISA Server if needed.ü Change the IIS Application Pool Identity if needed.ü Make sure MARS is not enabled.ü Connect to the master database to create or drop databasesü Create a user database for your application since tables cannot be created in masterü Disconnect and reconnect to change databasesü Create a clustered index or primary key on a table before inserting data.ü Remove any unsupported or deprecated features from the application.ü Avoid caching connections. Open the connection, use it, and then close it.ü Avoid making numerous round trips to the server.
  • Emphasize that we have tools and wizards to make the migration process smooth – within SQL Server and outside (i.e. MySQL)
  • This emphasizes exactly what the wizards and tools are doing FOR you.Full list athttp://www.microsoft.com/sqlserver/2008/en/us/R2.aspx
  • DemoSQL Azure firewall prevents all access to a SQL Azure server. The IP addresses of the machines that need access need to be granted access before they can attempt to connect to SQL Azure server. This can be done via the Firewall Settings tab under the Server Administration page on the SQL Azure portal. There is also a checkbox “Allow Microsoft Services access to this server”. Checking this will allow connections coming from your applications hosted in Windows Azure. The article How to Configure SQL Azure Firewall has more detailed information and instructions on configuring the firewall.http://msdn.microsoft.com/en-us/library/ee621782.aspxThe SQL Azure Database service is only available with TCP port 1433After you have used the SQL Azure portal to create a firewall setting that enables connection to your SQL Azure server, you can use the server-level principal login and the master database to view and edit your firewall settings.In the master database, the firewall settings are referred to as rules. The sys.firewall_rules view displays the current firewall settings and the sp_set_firewall_rule and sp_delete_firewall_rule stored procedures allow you to change the firewall settings. For Web roles - Check “Allow Microsoft Services access to this server” option under the Firewall Settings tab in the Server Administration page on the portal.
  • Demo
  • http://social.technet.microsoft.com/wiki/contents/articles/how-to-use-data-tier-application-import-and-export-with-sql-azure.aspx
  • Make sure to create a simple database which contains only objects that DacPacs support for demo
  • Explain that in VS2010 ‘SQL Server Data-tier Application == DACPAC’ – show that you can import, infer (a schema), etc..
  • Elastic ScaleService scales as resources requirements growNo-Code Sync ConfigurationEasily define data to be synchronizedSchedule SyncChoose how often data is synchronizedConflict HandlingHandle issues where same data is changed in multiple locationsLogging and MonitoringAdministration capabilities for tracking data and monitoring potential issues
  • As of this writing, SQL Azure Labs only works with NON @microsoft.com addresses.https://www.sqlazurelabs.com/
  • Good to go into detail to point out details
  • http://www.microsoft.com/en-us/sqlazure/Community/getstarted.aspx
  • Ask for suggestions!http://www.mygreatwindowsazureidea.com/pages/34685-sql-azure-feature-voting
  • I add this slide at the end of EVERY presentation.
  • Migrating to SQL Azure

    1. 1. Lynn Langit<br />lynnl@microsoft.com<br />Moving Your Data to the Cloud<br />Migrating Applications to SQL Azure<br />Sr. Developer Evangelist<br />http://blogs.msdn.com/SoCalDevGal<br />April 2011<br />
    2. 2. Migrating Applications to SQL Azure<br />Overview<br />SQL Azure – now and NEW<br />App Migration <br />Data Access Tier Considerations<br />Database Migration<br />Migrating to SQL Azure from MySql<br />Moving Schema and Data into SQL Azure<br />Transferring Large Data into SQL Azure<br />Future<br />
    3. 3. Windows Azure Platform<br />GENERAL PURPOSE PROGRAMMING LANGUAGES<br />Windows Azure Platform<br />App Fabric<br />Compute<br />Management<br />Relational database<br />CDN<br />Storage<br />Data Sync<br />Marketplace<br />
    4. 4. When Migrating Applications<br />Data Access APIs Support<br />Security Model<br />Connections & Sizing<br />Admin and Programmability Surface Support<br />Collation Behavior<br />
    5. 5. Data Access APIs<br />Supported APIs<br />Connection String<br />ADO.Net - Encrypt=True and add @servername to User ID<br />ODBC - Encrypt=yes and add @servername to Uid<br />
    6. 6. Data Access APIs cont.<br />Protocols<br />Authentication Mode<br />
    7. 7. Connectivity & Sizing<br />Robust Connection Management through Retry Logic<br />Failover<br />HW Failures or Upgrades<br />Resource Management Operations<br />Throttling and Load Balancing<br />ALTER DATABASE (T-SQL)<br />Changes to Database Name <br />Changes to MAXSIZE/EDITION<br />ALTER DATABASE [TestDB] MODIFY (MAXSIZE=50GB)<br />GO<br />
    8. 8. Security Management<br />Manage Logins - Authentication - SQL Server (only)<br />CREATE LOGIN [testlogin] WITH PASSWORD='password‘<br />Manage User<br />CREATE USER testuser FROM LOGIN testlogin;<br />Manage Server Roles<br />EXEC sp_addrolemember ‘dbmanager', 'testuser'; [securityadmin role]<br />EXEC sp_addrolemember ‘loginmanager', 'testuser'; [dbcreator]<br />Granting Database Access to a Login<br />Create Login and Database in Master<br />Create User and Grant Role in User Database<br />Views<br />sys.sql_logins. sys.databases, sys.database_principal<br />
    9. 9. Firewall Management<br />Portal Access<br />Programmatic Access<br />System Views and Stored Procedures - here<br />View: sys.firewall_rules<br />Stored Procedure: sp_set_firewall_rule<br />Stored Procedure: sp_delete_firewall_rule<br />API Implementation Example- here<br />
    10. 10. Collations<br />Default Collation - Set to SQL_LATIN1_GENERAL_CP1_CI_AS<br />Metadata, TempDb and Default for User Data <br />Object Names (tables, sprocsetc), String variables and Columns when no collation is specified. <br />Use column and/or expression level collation when needed<br />CREATE TABLE [dbo].[ErrorLog](<br /> [ErrorLogID] [int] IDENTITY(1,1) NOT NULL,<br /> [ErrorTime] [datetime] NOT NULL,<br /> [UserName] [nvarchar(4000)] COLLATE Turkish_100_CI_AI NOT NULL,<br /> [ErrorNumber] [int] NOT NULL,<br /> [ErrorMessage] [nvarchar](4000) COLLATE Japanese_CI_AS NOT NULL,<br /> CONSTRAINT [PK_ErrorLog_ErrorLogID] PRIMARY KEY CLUSTERED ([ErrorLogID] ASC)<br /> )<br />declare @strnvarchar(128) COLLATE Greek_CS_AI<br />
    11. 11. Feature Parity<br />Admin Surface – no physical administration<br />You have a master database <br />You do NOT have server level constructs (sp_configure, endpoints, DBCC commands, server level DMVs and System Views…)<br />Programmability Surface<br />Most RDMS features available<br />Partially available - USE, XML processing, deprecated T-SQL etc. – list here<br />Some Features are NOT available today<br />Full-text Search, Remote Data Access and Linked Servers, Distributed Transactions, Change Tracking, Service Broker etc.<br />List is available here<br />
    12. 12. Migrating Applications<br />
    13. 13. Database Migration<br />Moving Schema and / or Data<br />Source Database types<br />SQL Server<br />MySQL<br />Access<br />Other RDMS<br />
    14. 14. Data Migration Tools Overview<br />Wizards<br />SQL Azure Migration Wizard (CodePlex) – here<br />Migration Assistant for Access or for MySQL – here or here<br />Import/Export Wizard<br />Generate Script Wizard<br />Copy Database command<br />CREATE DATABASE DB2A AS COPY OF Server1.DB1A <br />Other Tools <br />SSIS <br />BCP<br />DataSync (CTP)<br />OData (CTP)<br />
    15. 15. From SQL Server to SQL Azure<br />GUI Tools<br />SSMS for R2 > Generate Script Wizard<br />SSMS for R2 > Import / Export Wizard<br />SSIS for R2<br />SQL Azure Migration Wizard<br />Command-line Tools<br />T-SQL script & bcp<br />Copy Database command<br />Import/Export Wizard for SQL Azure (command -> GUI)<br />3rd Party tools<br />
    16. 16. SSMS– Generate Script Wizard<br />Migration of schema and/or data w/ fine grain control<br />Pros - Native support for SQL Azure Schema options: “Engine Type = SQL Azure”<br />Ensures correct options and settings are applied for the TSQL script generation.<br />Requires explicit action on unsupported objects. <br />Cons - Verbose – INSERT Statements instead of raw data<br />Data is scripted with a fixed 100 row batch size.<br />Edit “GO” statements between small batches<br />Round-trip Efficiency<br />Use “SET NOCOUNT ON”<br />
    17. 17. Remove unsupported features, such as…<br />Migrating By Hand<br /><ul><li>USE DATABASE
    18. 18. ON PRIMARY (Filegroups)
    19. 19. Extended Properties
    20. 20. NOT FOR REPLICATION
    21. 21. Various Index options (WITH)
    22. 22. Windows logins
    23. 23. Unsupported XML features
    24. 24. Remove DEFAULT NEWSEQUENTIALID()
    25. 25. Encrypted Stored Procedures
    26. 26. No Heap tables (all tables must have clustered indices)
    27. 27. UDTs</li></li></ul><li>Generate Script Wizard - DEMO<br />Migrating Databases to SQL Azure<br />
    28. 28. SQL Azure Migration Wizard<br />http://sqlazuremw.codeplex.com<br />
    29. 29. What Could Go Wrong?<br />
    30. 30. Success!<br />
    31. 31. Migration Assist for MySql / Access (CTP)<br />Scenario - Auto porting of schema, database code and data from MySql and Access to SQL Azure<br />SQL Server Migration Assistant for MySql and Access<br />Supports MySQL 4.1 and up<br />Support Access v 97 and up<br />SQL Server versions supported (all editions)<br />SQL Azure, SQL Server 2005, SQL Server 2008 and 2008 R2<br />
    32. 32. MySQL to SQL Azure - DEMO<br />SQL Server Migration Assistant <br />Version for MySQL<br />Version for Access<br />
    33. 33. MySQL Migration Tool<br />
    34. 34. Access to SQL Azure Migration Wizard - DEMO<br />
    35. 35. SQL Azure - Import/Export<br />DAC v2.0 adds two new DAC services: import and exportImport and export services let you deploy & extract both schema & data from a single file identified with the “.bacpac” extension <br />
    36. 36. DAC (Data-tier Application) Package<br />Single unit for authoring, deploying, and managing data-tier objects (schema)<br />Development Lifecycle (VS 2010)<br />Creating / Editing DACs<br />Schema and DB Code Development<br />Code Analyses, Deployment Policy Settings<br />Schema Comparison and more…<br />Management Lifecycle (SSMS 2008 R2)<br />Extracting DACs (as files)<br />Managing DACs (deploy or upgrade [coming later this year for SQL Azure)<br />Registering existing database as DACs<br />If ‘regular’ into MSDB<br />If ‘Azure’ into master<br />If using UCP into UCP database<br />
    37. 37. DACPAC – DEMO in SSMS<br />In SSMS<br /><ul><li>Extract
    38. 38. Register
    39. 39. Monitor w/UCPs</li></ul>In VS 2010<br /><ul><li>Import
    40. 40. Create</li></li></ul><li>DACPAC – DEMO in VS<br />
    41. 41. Transferring Large Data to SQL Azure<br />Best Practices for efficient Data movement to SQL Azure<br />Use the right tools is key <br />BCP<br />SSIS <br />Network performance considerations<br />Latency vs Bandwidth<br />
    42. 42. BCP & Bulk Copy APIs for Large Data Transfer<br />Optimize Databases for Data Import<br />Disable/Delay creation of none Clustered Indexes<br />Order Data on the Clustered Index<br />Disable Triggers and Constraint checking<br />-N Native mode so no data type conversion needed. <br />-c Character mode for interoperability<br />-b batchsize will let you control transaction size<br />-h”TABLOCK, ORDER(…)” optimize writes<br />
    43. 43. Import/Export Wizard – for data transfer<br />Scenario - Simplified wizard for migrating schema and data through SSIS<br />Pros<br />Great performance out of the box<br />Allows ‘save as package’ for full control<br />
    44. 44. SSIS Data Flow Task (Large Data Xfer)<br />Diverse Source and destinations - To/From Flat Files, ADO.Net, OleDB<br />Fully programmable flow <br />Loops, Sorts, Conditional operators, XML/WebServices Processing etc<br />VS Debugging support with data viewers, watches and conditional breakpoints<br />Optimize Databases for Data Import<br />Disable/Delay creation of none Clustered Indexes<br />Order Data on the Clustered Index<br />Disable Triggers and Constraint checking<br />Batch Size: Adjust the transaction size<br />Buffer and Blob temp storage area; spread over to multiple drives for large data transfers<br />Parallelization – based on execution trees, task will auto parallelize<br />
    45. 45. SSIS package - DEMO<br />Use supported features only, such as bcp, but not BULK INSERT, etc…<br />
    46. 46. Parallelization & Network Perf<br />Latency & Bandwidth for high performance import & export<br />Latency is about laws of physics<br />Long distances means high latency<br />Parallelization can help mitigate some latency<br />Bandwidth is key! <br />Once you reach the bandwidth limit parallelization won’t help<br />
    47. 47. Datacenter Locations<br />
    48. 48. BCP Performance – test set up example<br />CREATE TABLE [dbo].[table1](<br /> [c01] [int] NOT NULL,<br /> [c02] [int] NOT NULL,<br /> [c03] [smallint] NOT NULL,<br /> [c04] [int] NOT NULL,<br /> [c05] [smallint] NOT NULL,<br /> [c06] [smallint] NOT NULL,<br /> [c07] [char](50) NOT NULL,<br /> [c08] [char](24) NOT NULL,<br /> …<br /> [c17] [char](24) NOT NULL,<br /> PRIMARY KEY CLUSTERED <br /> ([c01] ASC,[c02] ASC))<br />CREATE NONCLUSTERED INDEX [index1] <br />ON [dbo].[table1] ([c07] ASC)<br />Data Distribution:<br />Row Size: 600Bytes<br />Row Count: 100K<br />Pages: ~7700<br />Total Size: ~60MB<br />Even Distribution on Pkey<br />Constraints and Indexes<br />Compound Pkey (int+int) <br />None-clustered key on char(50)<br />No triggers or relationships<br />
    49. 49. BCP Upload Perf - Rows/Sec<br />
    50. 50. BCP Download Perf – Rows/sec<br />
    51. 51. Guidance on Data Transfer to SQL Azure<br />Split data transfer into multiple concurrent streams<br />Tune BCP batch size and network packet size option <br />Add non clustered indexes after loading data to SQL Azure. <br />Two additional indexes created before loading the data increased the final database size by ~50% and increased the time to load the same data by ~170%.<br />If, while building large indexes, you see a throttling-related error message, retry using the online option.<br />
    52. 52. COPY Database (same or different servers)<br />CREATE DATABASE destination_database_name AS COPY OF [source_server_name.]source_database_name<br />CREATE DATABASE Database2A AS COPY OF Server1.Database1A <br />Check via DMV<br />Progress<br />sys.dm_database_copies<br />Database COPY<br />
    53. 53. SQL Azure Data Sync <br />Elastic Scale<br />Service scales as resources requirements grow<br />No-Code Sync Configuration<br />Easily define data to be synchronized<br />Schedule Sync<br />Choose how often data is synchronized<br />Conflict Handling<br />Handle issues where same data is changed in multiple locations<br />Logging and Monitoring<br />Administration capabilities for tracking data and monitoring potential issues<br />CTP 1<br />CTP 2<br />
    54. 54. Data Sync <br />
    55. 55. Table Order in Sync<br />
    56. 56. Tracking Objects Created<br /><ul><li>Tracking Tables
    57. 57. On Source / on Destination
    58. 58. Triggers
    59. 59. Stored Procedures</li></li></ul><li>SQL Azure Data Sync CTP3<br /><ul><li>New UX integrated with the Windows Azure management portal.
    60. 60. Ability to select a subset of columns to sync as well as to specify a filter so that only a subset of rows are synced.
    61. 61. Ability to make certain schema changes to the database being synced without having to re-initialize the sync group and re-sync the data.
    62. 62. Conflict resolution policy can be specified.
    63. 63. General usability enhancements.</li></li></ul><li>Monitoring Tasks<br /><ul><li>Space Used
    64. 64. Monitor space used via ‘sys.dm_db_partition_stats’
    65. 65. Trap ‘out of space exception’ – SQL Error 40544
    66. 66. Synchronized Copies
    67. 67. Database copy
    68. 68. SQL Azure Synchronization Provider
    69. 69. Database backup / restore (and point-in-time restore) on 2011 Q2 Roadmap</li></li></ul><li>Data Migration Tools Summary<br />Wizards<br />SQL Azure Migration Wizard (CodePlex): http://sqlazuremw.codeplex.com/<br />Migration Assistant for Access or for MySQL:<br />http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5abe098d-c7e1-46c6-994a-09a2856eef0b&displaylang=en<br />Import/Export Wizard<br />Generate Script Wizard<br />Copy Database command<br />CREATE DATABASE DB2A AS COPY OF Server1.DB1A <br />Other Tools <br />SSIS <br />BCP<br />DataSync (CTP)<br />OData (CTP)<br />Import / Export Tool(coming spring 2011)<br />
    70. 70. Database Migration Tools <br />
    71. 71. Try SQL Azure for FREE<br />Activate your free trial!<br />www.sqlazure.com/getstarted<br />
    72. 72. What’s Your Idea?<br />
    73. 73. www.sqlazure.com/community<br />Check out tutorials and hear from MVPs…<br />
    74. 74. Track Resources<br />Team Blog – http://blogs.msdn.com/sqlazure<br />MSDN Dev Center – http://msdn.microsoft.com/azure/sqlazure<br />SQL Azure Labs – http://www.sqlazurelabs.com<br />Follow us on Twitter - @sqlazure<br />Windows Azure Platform Training Kit - http://bit.ly/dgvMv0<br />
    75. 75. TeachingKidsProgramming.org<br /><ul><li>Do a Recipe  Teach a Kid (Ages 10 ++)
    76. 76. Microsoft SmallBasic  Free Courseware (recipes)</li></li></ul><li>© 2011 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries.<br />The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.<br />

    ×