微软 azure_Microsoft Azure,我们迁移数据的第一步

微软 azure

The cloud is a buzzword in the IT world. Oracle, Amazon and Microsoft with Microsoft Azure are offering Cloud Services to the public. Most of the companies plan to have part of their environments in the cloud to reduce the maintenance and security effort.

云是IT世界中的流行语。 Oracle,Amazon和Microsoft以及Microsoft Azure正在向公众提供云服务。 大多数公司计划将其部分环境存储在云中,以减少维护和安全性工作。

Microsoft Azure offers a great solution to move your company information to the Clouds. That way you can access to your Servers, Databases, and Applications from your Tablet, Smartphone anywhere, anytime.

Microsoft Azure提供了一个出色的解决方案,可将您的公司信息迁移到云端。 这样,您可以随时随地从平板电脑,智能手机访问服务器,数据库和应用程序。


Figure 1. A screenshot of an Android Smartphone accessing to the Azure Administration Portal.


图1. 一个 Android智能手机 屏幕截图 访问 蔚蓝 管理 门户。

In this article, we will introduce to Microsoft Azure world, we will show how to create a Database and a Table in Azure and then we will show how to deploy a SQL Server Database to Microsoft Azure.

在本文中,我们将介绍Microsoft Azure世界,将展示如何在Azure中创建数据库和表,然后将展示如何将SQL Server数据库部署到Microsoft Azure。

什么是Windows Azure? ( What is Windows Azure? )

Azure is a Microsoft Platform hosted in the Microsoft Data Center used for multiple services like Virtual Machines, Web services, Databases, Cloud Services, Application Services, Media Services and more.

Azure是Microsoft数据中心中托管的Microsoft平台,用于多种服务,例如虚拟机,Web服务,数据库,云服务,应用程序服务,媒体服务等。


Figure 2. Some Available OSs in Azure like Windows, Linux Ubuntu, Coreos , SUSE, etc.


图2. Azure中一些可用的操作系统,例如Windows,Linux Ubuntu, Coreos ,SUSE等

With Azure, you can have multiple remote machines that you can access remotely anywhere. You can have Windows Servers or Linux Servers. In addition, you can have applications in Java, .NET, etc.

使用Azure,您可以拥有多台远程计算机,您可以在任何地方远程访问。 您可以拥有Windows服务器或Linux服务器。 此外,您可以使用Java,.NET等应用程序。

Azure is a multiplatform Portal.

Azure是一个多平台门户。

Microsoft Azure入门 ( Getting started with Microsoft Azure )

In order to start you need:

为了开始,您需要:

  • A Microsoft Account.

    一个Microsoft帐户。
  • A credit card (there is free trial for 3 months that requires a credit card).

    一张信用卡(有3个月免费试用需要一张信用卡)。

Once you have accomplished the requirements, go to the Microsoft Azure Portal.

完成要求后,请转到Microsoft Azure门户。

https://manage.windowsazure.com

https://manage.windowsazure.com

You will need to add personal information like your country, Address, telephone and your credit card information.

您将需要添加个人信息,例如您的国家/地区,地址,电话和信用卡信息。

Once you are registered, you will be able to see the Microsoft Azure Platform.

注册后,您将能够看到Microsoft Azure平台。


Figure 3 . the Microsoft Azure Portal


图3 微软Azure门户

The portal lets you Administer different cloud services like web sites, mobile services, SQL databases and more. In this sample, we are going to use SQL Databases. Click on the SQL DATABASES link.

该门户使您可以管理不同的云服务,例如网站,移动服务,SQL数据库等等。 在此示例中,我们将使用SQL数据库。 单击“ SQL DATABASES”链接。


Figure 4 Create a new Database with Azure


图4 使用Azure 创建 新数据库

The easiest way to create a database is the Quick Create option. For testing purposes is a good option, but in the real life is better to customize it with the custom create option.

创建数据库的最简单方法是“快速创建”选项。 出于测试目的,这是一个不错的选择,但是在现实生活中,最好使用custom create选项对其进行自定义。


Figure 5 Quick Database Creation


图5快速创建数据库

If it is your first time with Azure, you will need to create a New SQL database server.

如果这是您第一次使用Azure,则需要创建一个New SQL数据库服务器。


Figure 6 New SQL database server


图6 新SQL数据库 服务器

You will also need to specify a Login and password. Do not forget them to connect later. In SQL Server Azure, the SQL Server Authentication is used.

您还需要指定登录名和密码。 不要忘记他们以后再连接。 在SQL Server Azure中,使用SQL Server身份验证。


Figure 7. Creating a new Server with new login and password.


图7。 使用新的登录名和密码创建新的服务器。

If everything is OK, you will have a new Database created and a new Server. In this example, the Server name is Kadhym5bh and the database name sqlshack.

如果一切正常,您将创建一个新的数据库和一个新的服务器。 在此示例中,服务器名称为Kadhym5bh ,数据库名称为sqlshack


Figure 8. The database created in Microsoft Azure.


图8. 在Microsoft Azure中创建的数据库。

Now you have a database named sqlshack. In order to create a table, press the Manage option.

现在,您有了一个名为sqlshack的数据库。 为了创建表,请按管理选项。


Figure 9. Database Management in Azure


图9。 Azure中的数据库管理

You will receive a message to add your current personal machine IP to add to the list of allowed IP addresses. Without this option, your local server will not have access to the Azure server.

您将收到一条消息,将当前的个人计算机IP添加到允许的IP地址列表中。 如果没有此选项,则本地服务器将无法访问Azure服务器。


Figure 10. Message to allow the current local IP address.


10。 允许当前本地IP地址的消息。

You can create new tables from your Web Browser. The environment is friendly and simple.

您可以从Web浏览器创建新表。 环境友好而简单。


Figure 11. New table creation in Azure


图11。 在Azure中创建新表

You can also add columns to the table using the Columns link.

您还可以使用“列”链接将列添加到表中。


Figure 1 2 . Column creation in Azure


图1 2 在Azure中创建列

You can also add Data to the table.

您也可以将数据添加到表中。


Figure 1 3. Adding Data


图1 3. 添加数据

如何使用本地SSMS连接到Azure ( How to connect to Azure with the local SSMS )

Now in the SQL Server Management Studio (SSMS), connect to the Database Server Using the following syntax:

现在,在SQL Server Management Studio(SSMS)中,使用以下语法连接到数据库服务器:

ServerName.database.windows.net (see the figure 8 to find the Server Name)

ServerName.database.windows.net (请参见图8查找服务器名称)

使用SQL Server身份验证 ( Use SQL Server Authentication )

Use the login used when you created the database (see the figure 7 for your login and password information)

使用创建数据库时使用的登录名(有关登录名和密码信息,请参见图7)


Figure 14. Windows to connect to Azure


图14. Windows连接到Azure

You will be able to connect to the kadhym5bh server and you will be able to see the sqlshack database.

您将能够连接到kadhym5bh服务器,并且将能够看到sqlshack数据库。


Figure 15. The sqlshack database visualized in SSMS.


图15。 在SSMS中可视化 sqlshack 数据库。

The SQL Azure looks similar to a local database at the beginning.

SQL Azure在开始时看起来类似于本地数据库。


Figure 16. The SQL Azure Database expanded.


图16. SQL Azure数据库已展开。

You will also notice that the options to administer a SQL Azure Database are limited. In the following example, Right click on the table folder to create a new table.

您还将注意到,用于管理SQL Azure数据库的选项是有限的。 在以下示例中,右键单击表格文件夹以创建一个新表格。


Figure 17. The SSMS limitations on Azure


图17. Azure上的SSMS限制

As you can see, the SSMS only generates T-SQL templates instead of showing visual interfaces to create objects. For many options, the T-SQL is the only way to create objects and add data.

如您所见,SSMS仅生成T-SQL模板,而不显示用于创建对象的可视界面。 对于许多选项,T-SQL是创建对象和添加数据的唯一方法。


Figure 18. The T-SQL code generated to create a table in SQL Azure.


图18. 生成的T-SQL代码,用于在SQL Azure中创建表。

如何将SQL Server数据库部署为Azure数据库 ( How to deploy a SQL Server Database as an Azure Database )

Today, most of the people have local and Virtual Remote Servers in the Cloud. A common task is to migrate some data from the local database to Azure.

如今,大多数人都在云中拥有本地和虚拟远程服务器。 一个常见的任务是将某些数据从本地数据库迁移到Azure。

In this new example, we are going to deploy a local database in SSMS as an Azure SQL Database. In order to do this, right click on your database and select the Deploy Database to Windows Azure SQL Database option.

在这个新示例中,我们将在SSMS中部署本地数据库作为Azure SQL数据库。 为此,请右键单击数据库,然后选择“将数据库部署到Windows Azure SQL数据库”选项。


Figure 19. Deploying a Database to an Azure database.


图19。 将数据库部署到Azure数据库。

The Deploy Database Wizard will be displayed.

将显示“部署数据库向导”。


Figure 20. The deploy Wizard.


图20. 部署向导。

You will be prompted the database name to be used in Azure. A temporary file will be used for the creation. Click the Connect button to connect to Azure.

系统将提示您在Azure中使用的数据库名称。 临时文件将用于创建。 单击“连接”按钮以连接到Azure。


Figure 21 . The deployment settings


图21 部署设置

Specify the same connection information used to connect to Azure from the SSMS and press connect.

指定用于从SSMS连接到Azure的相同连接信息,然后按connect。


Figure 22. Connection information.


图22。 连接 信息。

Finally, you will have the summary of the configuration wizard. Verify if everything is OK.

最后,您将获得配置向导的摘要。 验证是否一切正常。


Figure 23. The summary of the wizard settings.


图23。 向导设置摘要。

The final step is the result window. If everything is OK, all should be green.

最后一步是结果窗口。 如果一切正常,则所有指示灯应为绿色。


Figure 24. The successful messages.


图24。 成功的消息。

If you refresh the Azure SQL Server, you will find the new Database deployed.

如果刷新Azure SQL Server,则将发现已部署的新数据库。


Figure 25 . The database migrated to Azure.


图25 数据库已迁移到Azure。

In addition, if you go to the Azure Portal, you will find the d1 database created.

此外,如果转到Azure门户,则会找到创建的d1数据库。


Figure 26. The database deployed in Azure.


图26. 在Azure中部署的数据库。

结论 ( Conclusion )

As you can see, the SQL Server tends to be handled in Virtual Servers in the future. The tendency is to migrate the traditional databases to the cloud. These days, the companies are using Hybrid environments where part of the information is Local and part in Azure or other Virtual Servers.

如您所见,将来SQL Server倾向于在虚拟服务器中处理。 趋势是将传统数据库迁移到云。 如今,这些公司正在使用混合环境,其中部分信息是本地信息,而部分信息在Azure或其他虚拟服务器中。

翻译自: https://www.sqlshack.com/microsoft-azure-first-steps-migrate-data/

微软 azure

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值