Windows Azure features and then began to support the expansion -SQL Database import and export functions

This article will introduce the new SQL Database import and export functions to help you can import the data layer through the application database to SQL Database, or export to SQL Database Cloud Storage.


[ Background note ]

See on Facebook Eric Shangkuan share ScottGu published article, it is mentioned in the Windows Azure Platform Management Portal of the many new features to expand again, which includes the following features:

  • Service Bus Management and Monitoring
  • Support for Managing Co-administrators
  • Import/Export support for SQL Databases
  • Virtual Machine Experience Enhancements
  • Improved Cloud Service Status Notifications
  • Media Services Monitoring Support
  • Storage Container Creation and Access Control Support

This article first carried Profile for Import / Export support for SQL Databases function, other new features and then gradually come to share with you.

[ Import database to SQL Database ]

To import the database SQL Database you can follow these steps:

1. Establish Storage.

To import the current database to SQL Database only through the Windows Azure Storage (hereinafter referred STORAGE) When the media, and must be packaged into BACPAC first database package files, I assume you have not created STORAGE ACCOUNT, so the first step you must first create STORAGE Navigation column ACCOUNT, please Windows Azure Platform Management Portal and-click [(Navigation Panel) in STORAGE ], then to the right side of the page click on [ CREATE STORAGE ACCOUNT ].

image

STORAGE enter the URL as long as the URL is not repeated, you can be named according to their own habits or logic STORAGE URL, then select the data center or AFFINITY GROUP which area you want to put STORAGE, STORAGE ACCOUNT then choose to open the Windows Azure subscription. You can choose according to your needs whether to enable STORAGE of geographic replication, and finally press CREATE STORAGE ACCOUNT.

image

When the STATUS display as the STORAGE Online you have set up.

image

2. Build Container.

Click STORAGE you just created (paper dacbacstorage for example) to create a Container.

image

[Click on the main screen STORAGE CONTAINERS ] to create the container is placed next to the package BAC profile.

image

On the Container Home Inquiry [ CREATE A BLOB CONTAINER ].

image

于【New blob container】窗口中输入 Container 的名称以及选择存取权限,默认为 Private 只有建立这个容器的账号有权限存取;若你想要公开 blob 给其他人存取,可以选择 Public Blob;另外你也可以选择 Public Container,来把整个 Container 的相关属性及 metadata 都公开,请注意这是完整公开,选择这个选项前请考虑清楚。

image

建立完毕之后您于下图看到刚刚所建立的 Container,请记住您的  Blob Container 的 URL,等下部署 BAC 封装会用到。

image

另外您还必须到准备 STORAGE 的 Manage Key,请于 Windows Azure Platform Management Portal  点选巡览列【STORAGE > MANAGE KEYS】。

image

记住 STORAGE ACCOUNT NAME 和 PRIMARY ACCESS KEY 或 SECOND ACCESS KEY 其中一组 KEY,这在下面的步骤利用 SSMS 产生数据层应用程序的时候用到。

image

3. 产生 BAC 封装档。

开启 SQL Server Management Studio 2012,于对象总管点选【您要产生 BAC 封装档的数据库 > 工作 > 导出数据层应用程序】。

image

在【导出数据层应用程序】窗口的【简介】步骤点选下一步,或是您也可以勾选【不要再显示此页面】。

SNAGHTML5188cbf

于【导出设定】选择【保存至 Windows Azure】然后按【连接】。

SNAGHTML51a56c1

输入 STORAGE ACCOUNT NAME 以及 PRIMARY ACCESS KEY (或 SECONDARY ACCESS KEY)然后按连接。

SNAGHTML52456c1

顺利连上 STORAGE 后,从下拉菜单中可以选到您建立的 Container,选择完毕之后按下一步。

SNAGHTML52a992d

最后按完成来开始将 SQL Server 中的数据库导出成数据层应用程序,并部署到 STORAGE。

SNAGHTML52bade5

若顺利导出成功后请按关闭。

SNAGHTML53312a1

截至此步骤要透过 SQL Database 的新功能来导入数据库的前置作业就已经完成。

4. 从 STORAGE 导入数据层应用程序封装档。

点选左侧巡览列的 SQL DATABASES,您就可以看到下方多出了之前所没有的【IMPORT】功能。

image

于【IMPORT DATABASE】窗口中点选数据夹图示。

image

接着您就可以找到您在步骤 3 透过 SSMS 所部署的 BAC 封装档。

image

接着您可以依照下列的字段来进行相关的组态设定:

  • Name:数据库名称,默认会跟您产生BAC 封装档的数据库相同。
  • SUBSCRIPTION:请选择适当的 Windows Azure 订阅。
  • SERVER:选择您要将 BAC 封装档部署到哪台 SQL Database 服务器。
  • LOGIN NAME、PASSWORD:输入足够权限的 SQL Database 管理账号。
  • Configure advanced database settings:您可以视情况选择是否进行进阶设定。

image

当您勾选【Configure advanced database settings】您就可以设定 SQL Database  所要使用的版本以及最大数据库容量。

image

接着您就可以看到正在导入数据库的消息。

image

导入完成之后您就可以在 SQL Database 页面上看到您透过 BAC 封装档所导入的数据库。

image

导出 SQL Database 数据库

若您想要将 SQL Database 中的数据库导出来,首先您必须要有 STORAGE Account 并建立好 Container,设定方式可以参考前述的步骤。接着于Windows Azure Platform Management Portal 的巡览列(Navigation Panel) 点选 SQL Databases,然后选择【EXPORT】,本文以 pubs 数据库为例,示范如何将 SQL Database 导出。

image

于【Export Database】窗口中输入下列资讯:

  • FILENAME:从 SQL Database 导出为数据层封装程序的文件名称。
  • SUBSCRIPTION:选择适当的 Windows Azure 订阅。
  • BLOB STORAGE ACCOUNT:选择适当的 STORAGE ACCOUNT 或建立新的 ACCOUNT。
  • CONTAINER:选择适当的 Container 或建立新的 Container。
  • SERVER LOGIN NAME、PASSWORD:输入 SQL Database 的登入名称和密码。

image

接着您就可以看到如下图正在导出 SQL Database 的状态。

image

检视导入导出纪录

With the new import and export functions, you can view SQL Database import and export records in the Windows Azure Platform Management Portal, please click on the Navigation column [ SQL DATABASES> SERVERS> Your SQL Database Server ].

image

Click [SQL Database Server in the main screen HISTORY ].

image

After entering SQL Database login account and password, you can see all the databases on the server export and import records.

image

[ Reference Data ]

- Announcing: Improvements to the Windows Azure Portal

- How to: Import and Export a Database (Windows Azure SQL Database)

- How to: View Import and Export Status of Database (Windows Azure SQL Database)

Original: Big Box  Windows Azure features and then began to support the expansion -SQL Database import and export functions


Guess you like

Origin www.cnblogs.com/chinatrump/p/11505166.html