SQL Azure Import/Export Service has been released to Production


SQL Azure Import/Export Service has been released to Production as of today!!!

SQL Azure Import/Export Service is available at free of charge for SQL Azure customers.

For more information visit the following blog post

SQL Azure Sync CTP2 – Synchronize SQL Azure with On Premise SQL Server and vice versa– How Sync Framework Tracks changes in databases – Part 3


In the previous posts, we saw How to download, install and configure SQL Azure Sync Agent and then How to define Sync Group, Manually run the sync and How to define Schedules to run the Sync automatically

In this post, we will How SQL Azure Sync provisions the databases and How it identifies the changes in the data and upload or download the changes

Open Management Studio and connect to SQL Azure server which we used for Sync Group

image

And then connect to on premise SQL Server and open Countries database, you can see the Tracking Triggers and Stored Procedures for each tables

image

image

If you look at the list of the tables, For each table we added for Sync, a new table has been added for tracking

Ex. DataSync.city_dss_Tracking

image

This table will be populated based on the Trigger created on the Main Data table

image

Let us insert a new record and see how it works

To verify that there is no city exists with name “Parisppany” we will run the below query on SQL Azure server

image

The above query returns 0 rows

image

Now insert a new record for City table in on premise SQL Server, if you see the Output Messages, you will see 3 messages, its due to Adding record in both Tracking table and Main table

Let us check the Main table

image

Now let us check the Tracking table

image

The tracking table ID column refers to the Primary Key of main data table and it contains timestamp information to identify when the record was created or updated or deleted

When record is deleted “Sync_Row_Is_TombStone” will be set to 1

Other Tracking Tables:

There are 3 other tracking tables created during Sync Provisioning process

1. [DataSync].[scope_config_dss]

2. [DataSync].[scope_info_dss]

3. [DataSync].[schema_info_dss]

[DataSync].[scope_config_dss] table contains the schema of the tables which are syncronized as XML data

image

If you open and view the XML Data, you will see the Tables as Adapters, along with details of Tracking tables, Procedures and Triggers used for tracking

image

I hope this post gives you an idea of How SQL Azure Sync service identifies the changes and updates the data.

Please post your comments !!!

Advertisement

SQL Azure Sync CTP2 – How to Synchronize SQL Azure with On Premise SQL Server and vice versa–Create Sync Groups and Schedules – Part 2


In the last post, we saw how to download, install the SQL Azure Sync Agent and configure it

In this post, we will see how to Create a Sync Group to include SQL Azure database and SQL Server On premise database, Synchronize them, and create a schedule to run them automatically.

Login to https://datasync.sqlazurelabs.com using your Azure account

image

Click on “New Sync Group” to define a new Sync Group

image

enter the name of the Sync Group and click on Database combo and select “Register New SQL Azure Database…”

image

Once selected this option, SQL Azure Database registration screen will popup

image

Specify the SQL Azure server name, Database name, User name and password and click “Test” to test the connection and then click “Save”

image

Click “Add” to add the database to Member List and click on “Set Hub” to specify it as main server

Again click on Database combo and select the On Premise database and click “Add”

image

Once completed adding the Hub and Sync Members, click “Next” to proceed

image

Select the table you want to Sync from “Available Tables” list and then click on Right Arrow to move to “Selected Tables

Once done selecting the tables, click on “Create Sync Group

image

To synchronize the databases initially, click on “Sync Now” button

image

Once the sync process starts, it will automatically redirect to “Sync Logs” tab, you can filter the logs by Sync Group and Database.

For initial sync, you will see 3 tasks, Provisioning of SQL Azure database for sync, Provisioning of SQL Server for Sync and then Sync the data

Once the tasks are completed, the Task state icon will change from Execution state to Ready State

image

To view the detailed log for each task, click on “View Log”

image

If you see the text marked showed in Yellow, it shows the total number of records downloaded.

Now we have successfully defined a Sync group and synchronized the data from SQL Azure and SQL Server bidirectional,

Let us now setup the Sync Group as a scheduled job

Click on “Sync Groups” and then select the Sync Group and click on “Edit

image

In the Edit screen, you add additional Sync Members, you can change the Sycnhronization direction

image

You can schedule the sync job to run on specific intervals of time

image

After select the schedule, click on “Save”, Now your sync job will automatically run every 15 minutes once or as per your schedule definition

image

Now you might be wondering, How the Sync Service identifies the changes made to data, Let us see that in the next post.

I hope you all find this post useful. Please post your comments !!!

SQL Azure Sync CTP2 – How to Synchronize SQL Azure with On Premise SQL Server and vice versa–Part 1


SQL Azure Data Sync CTP2 is a SQL Azure Labs beta project which is a cloud-based data synchronization service built on Microsoft Sync Framework.

Using SQL Azure Data Sync you can synchronize data between SQL Azure to SQL Azure or SQL Azure to On Premise SQL Server on specific schedules for the specific tables.

You can sign up for SQL Azure Data Sync CTP2 invite in this website http://connect.microsoft.com/sqlazurectps

In this post, we will see how to Setup a Sync job to synchronize data between SQL Azure and SQL Server bi directionally

Once you received the Invitation Code from Microsoft Connect, you can activate the Sync CTP2 account in SQL Azure Labs (http://connect.microsoft.com/sqlazurectps )

After activating the Invite Code, Please login to https://datasync.sqlazurelabs.com using your Azure account

Sync Dashboard – has options to Manage the Sync Group, Databases (SQL Azure and On Premise SQL Server Databases), Agents

clip_image002

Let us first setup a Agent in Local SQL Server machine, click on “Agents” tab to download the Agent Setup

image

Click on “AgentServiceSetup.msi” link to save the MSI to your computer where you want to run the setup

Before installing the setup, we need to Generate Agent Key, Agent Key is unique to each Agents (Computers), used for its identification, To generate agent key, click on “Generate Agent Key

image

Specify the Name of the Agent, and then click “Generate”

image

The Agent Key will be generated and saved automatically, to view the Agent’ Key click on the Agent Name,

image

The Agent Key will be displayed on the right side, Copy that save it for your reference, we will use this during Agent Installation, if you have multiple agents, you need to generate multiple keys. You cannot use the same key for multiple agent installations.

If you notice the Status column, it will be shown as Warning, the reason is Agent is not communicating to the SQL Azure Sync Server.

Let us now install the agent and configure it to communicate to SQL Azure Sync Server

To install the agent, open the folder where you have saved the AgentSerivceSetup.msi and run the setup

image

image

Click “Next” to proceed

image

Select “I Agree” and then Click “Next” to proceed

image

Specify the Service Account User Name and Password, If you are planning to use Windows Authentication for accessing the databases for Sync Process, please make sure this Service User has permissions to connect to SQL Server and access the databases.

After specify the Service username and password, click “Next” to proceed

image

Select the installation folder, specify whether to install just for you or for every one and then click “Next” to proceed

image

Click “Next” to confirm the installation and proceed

image

Installation will continue

image

Once the installation is completed, click “Close” to complete the setup.

Before stating the Sync Agent Configuration program, please go to Control Panel –> Administrative Tools –> Service to start the “SQL Azure Data Sync Service”

image

Right click on the service and then click “Start”

Go to Start Menu –> All Programs –> Microsoft SQL Azure Data Sync CTP, the following two shortcuts will be available

image

Click on “SQL Azure Data Sync Agent CTP2” to start the Sync Configuration program

image

Click on “Edit Agent Key” to setup the Agent Key

image

Copy the Agent Key we saved earlier and paste it here and click “Ok” to proceed

Once saved click on “Ping Sync Service” to check whether the Agent is able to successfully connect to SQL Azure Sync Server

image

On success connection, you should get this below message

image

Click “Ok” to proceed and then click “Add Member” to add a new database for doing synchronization

image

Select the tab based on the authentication you are planning to do, In this demo we are going to “Windows Authentication”, after select the tab, specify the name of the SQL Server Instance and then specify the database and then click “Test Connection”

image

Once the connection is successful, click on “Save” to save the Sync Member

If you want to change the database or Authentication, click on “Properties” to edit the saved Sync Member.

To delete the Sync Member, use “Delete Member” option

image

Click on “Check Member Schema” option to verify the selected database schema is compatible for SQL Azure sync

image

Now you have successfully download the agent, generated the agent key, installed the agent and configured the Agent and Sync Member ready for Sync.

In the next post we will see how to configure the Sync Group and schedule the sync job and synchronize the data between SQL Azure to SQL Server and vice versa.

I hope you all find this information helpful, Please post your comments and feedback !!!

%d bloggers like this: