SQL Azure provides a range of data replication and synchronization mechanisms. For example, a local SQL Server database can be published on SQL Azure, and SQL Azure's database can be packaged and downloaded to a local SQL Server server, and you can also back up the database through the Data Sync service. and dynamic Data synchronization.
Data-tier applications
The data-tier application (Data-tier application, DAC) encapsulates all the database and instance objects used by an application, such as tables, indexes, views, stored procedures, and even users.
With this logical encapsulation, the developer can set up and modify the database directly, and then give the encapsulated database definition to the database administrator for deployment on any DAC-enabled database.
The DAC avoids the complexity of maintaining database scripts and also weakens the interdependence between developers and database administrators.
The DAC also provides automated database updates that ensure data is not lost in the process of updating data structures.
DAC also supports versioning, so developers and database administrators can manage different DAC versions like the source code version.
In the DAC operation process is often to surging ah two file types, one is. Bacpac, one is. Dacpac
-Bacpac:. Bacpac file contains the structure and data in a database. The database structure information is the same as the information in the. dacpac file, and the data is stored in JSON format.
Logically,. Bacpac is the equivalent of a database backup, and its primary role is in database porting.
- . Dacpac: . Dacpac file contains a structure in a database, whose primary role is to deploy the database structure to different environments and to update the database structure.
First we need to install SQL Server 2012 locally and install SQL Server Management Studio.
In this chapter I will explain how to import a database from SQL Azure in the cloud into a local SQL Server database.
1. Prepare first, we use SQL Server Management Studio to create a SQL Azure in the cloud, named leidb. Create several tables at the same time. The following figure:
2. Create a storage account, named leizhangstorage (you can choose whether the need for offsite redundancy according to your own needs), and create container named dbbackin storage, Set container permissions to private.
3. Log in to Windows Azure Management Portal and select the SQL Azure we created in step 1, click Export, as shown below: