Getting Started with Windows Azure SQL Data Sync

In this tutorial, you learn the fundamentals of Windows Azure SQL Data Sync using the Windows Azure (Preview) portal.

This tutorial assumes minimal prior experience with SQL Server and Windows Azure SQL Database. In this tutorial, you create a hybrid (SQL Server and SQL Database instances) sync group fully configured and synchronizing on the schedule you set.

Table of Contents

Step 1: Connect to the Windows Azure SQL Database

  1. Sign in to the Management Portal.

  2. Click SQL DATABASES in the left pane.

  3. Click SYNC at the bottom of the page. When you click SYNC, a list appears showing the things you can add – New Sync Group and New Sync Agent.

  4. To launch the New SQL Data Sync Agent wizard, click New Sync Agent.

  5. If you haven't added an agent before, click download it here.

Step 2: Add a Client Agent

This step is required only if you are going to have an on-premises SQL Server database included in your sync group. You can skip to Step 4: Create a sync group if your sync group has only SQL Database instances.

Step 2a: Install the required software

Be sure that you have the following installed on the computer you install the Client Agent.

  • .NET Framework 4.0

    You can install .NET Framework 4.0 from here.

  • Microsoft SQL Server 2008 R2 SP1 System CLR Types (x86)

    You can install the Microsoft SQL Server 2008 R2 SP1 System CLR Types (x86) from here

  • Microsoft SQL Server 2008 R2 SP1 Shared Management Objects (x86)

    You can install the Microsoft SQL Server 2008 R2 SP1 Shared Management Objects (x86) from here

Step 2b: Install a new Client Agent

Follow the instruction at Install a Client Agent (SQL Data Sync) to install the agent.

Step 2c: Finish the New SQL Data Sync Agent wizard

  1. Return to the New SQL Data Sync Agent wizard.
  2. Give the agent a meaningful name.
  3. From the dropdown, select the REGION (data center) to host this agent.
  4. From the dropdown, select the SUBSCRIPTION to host this agent.
  5. Click the right-arrow.

Step 3: Register a SQL Server database with the Client Agent

After the Client Agent is installed, register every on-premises SQL Server database that you intend to include in a sync group with the agent. To register a database with the agent, follow the instructions at Register a SQL Server Database with a Client Agent.

Step 4: Create a sync group

Step 4a: Start the New Sync Group wizard

  1. Return to the Management Portal.
  2. Click SQL DATABASES.
  3. Click ADD SYNC at the bottom of the page then select New Sync Group from the drawer.

Step 4b: Enter the basic settings

  1. Enter a meaningful name for the sync group.
  2. From the dropdown, select the REGION (Data Center) to host this sync group.
  3. Click the right-arrow.

Step 4c: Define the sync hub

  1. From the dropdown, select the SQL Database instance to serve as the sync group hub.
  2. Enter the credentials for this SQL Database instance – HUB USERNAME and HUB PASSWORD.
  3. Wait for SQL Data Sync to confirm the USERNAME and PASSWORD. A green check mark appears to the right of the PASSWORD when the credentials are confirmed.
  4. From the dropdown, select the CONFLICT RESOLUTION policy.

    Hub Wins – any change written to the hub database is written to the reference databases, overwriting changes in the same reference database record. Functionally, this means that the first change written to the hub is propagated to the other databases.

    Client Wins – changes written to the hub are overwritten by changes in reference databases. Functionally, this means that the last change written to the hub is the one kept and propagated to the other databases.

  5. Click the right-arrow.

Step 4d: Add a reference database

Repeat this step for each additional database you want to add to the sync group.

  1. From the dropdown, select the database to add.

    Databases in the dropdown include both SQL Server databases that have been registered with the agent and SQL Database instances.

  2. Enter credentials for this database – USERNAME and PASSWORD.
  3. From the dropdown, select the SYNC DIRECTION for this database.

    Bi-directional – changes in the reference database are written to the hub database, and changes to the hub database are written to the reference database.

    Sync from the Hub - The database receives updates from the Hub. It does not send changes to the Hub.

    Sync to the Hub - The database sends updates to the Hub. Changes in the Hub are not written to this database.

  4. To finish creating the sync group, click the check mark in the lower right of the wizard. Wait for the SQL Data Sync to confirm the credentials. A green check indicates that the credentials are confirmed.

  5. Click the check mark a second time. This returns you to the SYNC page under SQL Databases. This sync group is now listed with your other sync groups and agents.

Step 5: Define the data to sync

Windows Azure SQL Data Sync allows you to select tables and columns to synchronize. If you also want to filter a column so that only rows with specific values (such as, Age>=65) are synchronized, use the SQL Data Sync portal at Windows Azure and the documentation at Select the Tables, Columns, and Rows to Synchronize to define the data to sync.

  1. Return to the Management Portal.
  2. Click SQL DATABASES.
  3. Click the SYNC tab.
  4. Click the name of this sync group.
  5. Click the SYNC RULES tab.
  6. Select the database you want to provide the sync group schema.
  7. Click the right-arrow.
  8. Click REFRESH SCHEMA.
  9. For each table in the database, select the columns to include in the synchronizations.
    • Columns with unsupported data types cannot be selected.
    • If no columns in a table are selected, the table is not included in the sync group.
    • To select/unselect all the tables, click SELECT at the bottom of the screen.
  10. Click SAVE, then wait for the sync group to finish provisioning.
  11. To return to the Data Sync landing page, click the back-arrow in the upper left of the screen (above the sync group’s name).

Step 6: Configure your sync group

You can always synchronize a sync group by clicking SYNC at the bottom of the Data Sync landing page. If you want a sync group to synchronize on a schedule, you configure the sync group.

  1. Return to the Management Portal.
  2. Click SQL DATABASES.
  3. Click the SYNC tab.
  4. Click the name of this sync group.
  5. Click the CONFIGURE tab.
  6. AUTOMATIC SYNC
    • To configure the sync group to sync on a set frequency, click ON. You can still sync on demand by clicking SYNC.
    • Click OFF to configure the sync group to sync only when you click SYNC.
  7. SYNC FREQUENCY
    • If AUTOMATIC SYNC is ON, set the synchronization frequency. The frequency must be between 5 Minutes and 1 Month.
  8. Click SAVE.

Congratulations. You have created a sync group that includes both a SQL Database instance and a SQL Server database.

Next Steps

For additional information on SQL Database and SQL Data Sync see:

最新文章

  1. redis持久化以及主从服务器的配置
  2. Java Selenium封装--RemoteWebElement
  3. CSS常用样式(一)
  4. 黑马程序员——JAVA基础之网络编程
  5. ORACLE 总结
  6. jquery 获取属性的值
  7. Winfrom 基于TCP的Socket 编程
  8. HDU 3833 YY's new problem(换种思路的模拟,防超时)
  9. Unity3D 与 objective-c 之间数据交互。iOS SDK接口封装Unity3D接口
  10. .net web部署(IIS Express && Nancy Self-Hosting)
  11. 一个简单LINUX程序的逆向
  12. Linux新手笔记 ibus
  13. linux下GBK->UTF-8文件编码批量转换脚本
  14. angularJS的$http.post请求,.net后台接收不到参数值的解决方案
  15. Linux服务器限制ssh登录,查看登录日志
  16. 页面检测网络外网连接- 网页基础模块(JavaScript)
  17. 基于TDA4863-2的单级PFC反激LED电源设计与仿真
  18. Linux之Ubuntu安装Sublime
  19. LICEcap方便快捷制作gif图片的工具
  20. React页面隐藏#

热门文章

  1. 怎样彻底清楚Chrome缓存数据
  2. Nginx Parsing HTTP Package、header/post/files/args Sourcecode Analysis
  3. 不可或缺 Windows Native (2) - C 语言: 常量,变量,基本数据类型
  4. Android 摇一摇之双甩功能
  5. 取消界面的title
  6. valueOf跟toString区别
  7. mysql互为主从复制配置笔记
  8. Centos如何设置静态IP地址,LINUX怎么修改IP地址
  9. Android 布局学习之——Layout(布局)具体解释二(常见布局和布局參数)
  10. How To Add Swap on Ubuntu 14.04
  11. Ubuntu 14.04 使用MyEclipse 10.7 闪退解决
  12. oh-my-zsh 安装和使用
  13. intellij idea 在什么地方打开终端Terminal
  14. chown 命令详解
  15. Angular UI框架 Ng-alain @delon的脚手架的生成开发模板
  16. Spring系列(一) Spring的核心
  17. 百战程序员——EL、JSTL
  18. python 函数指动态形参,作用域
  19. centos6.5换yum源
  20. 修改Spring Boot默认的上下文