sql azure 语法

In this article, we will review how to set up auto-failover groups in Azure SQL Server and how failover group is different from active geo-replication in Azure. Auto-failover group is an Azure SQL database feature that replicates one or a group of databases to the secondary Azure SQL server in the cross-region. We cannot have a secondary server in the same region. This feature is used to failover all the databases in the failover group in case of disaster and the failover is automatic.

在本文中,我们将回顾如何在Azure SQL Server中设置自动故障转移组以及故障转移组与Azure中的活动地理复制有何不同。 自动故障转移组是一种Azure SQL数据库功能,可将一个或一组数据库复制到跨区域的辅助Azure SQL服务器。 我们不能在同一区域中有辅助服务器。 此功能用于在发生灾难时对故障转移组中的所有数据库进行故障转移,并且故障转移是自动的。

Auto-failover group uses the same underlying technology as geo-replication. The following are some of the differences between auto-failover groups and active geo-replication.

自动故障转移组使用与地理复制相同的基础技术。 以下是自动故障转移组和活动地理复制之间的一些区别。

  • Geo-replication replicates a single database to the secondary whereas auto-failover groups replicate a group of databases that are added to the failover group 地理复制将单个数据库复制到辅助数据库,而自动故障转移组将复制添加到故障转移组的一组数据库
  • Auto-failover supports managed instances whereas geo-replication does not 自动故障转移支持托管实例,而地理复制不支持
  • Both manual and auto-failover are available in auto-failover groups whereas only manual failover is possible in Azure SQL active geo-replication 手动故障转移和自动故障转移在自动故障转移组中均可用,而在Azure SQL活动地理复制中只能进行手动故障转移
  • Auto-failover supports only one secondary server. If you need multiple secondary databases, consider using active geo-replication 自动故障转移仅支持一台辅助服务器。 如果需要多个辅助数据库,请考虑使用活动的地理复制

Please refer to Azure SQL database Geo-Replication to set up geo-replication on an Azure SQL database.

请参考Azure SQL数据库地理复制以在Azure SQL数据库上设置地理复制。

Let us go step by step to configure auto-failover group on an Azure SQL server.

让我们一步一步地在Azure SQL服务器上配置自动故障转移组。

在Azure SQL服务器上配置自动故障转移组 (Configuring Auto-Failover group on Azure SQL server)

Log in to the Azure portal and go to the SQL Server page. You can search for SQL Server in the search box. Please refer to the below image.

登录到Azure门户,然后转到“ SQL Server”页面。 您可以在搜索框中搜索SQL Server。 请参考下图。

Click on the server on which you are going to configure failover groups. In the server details page, click on Failover groups.

单击要在其上配置故障转移组的服务器。 在服务器详细信息页面中,单击故障转移组。

Click on the Add group. Enter the failover group name which used to connect the current primary server. Select the secondary server if you already have one in different region else create a new SQL server in a different region. The secondary server in the same region is not supported in failover groups in Azure SQL Server.

单击添加组。 输入用于连接当前主服务器的故障转移组名称。 如果您已经在其他区域中有一个辅助服务器,请选择辅助服务器,否则在其他区域中创建一个新SQL Server。 Azure SQL Server的故障转移组中不支持同一区域中的辅助服务器。

Select the read/write failover policy. Select Automatic if you need automatic failover when the primary goes down. Select the read-write grace period.

选择读/写故障转移策略。 如果在主服务器停机时需要自动故障转移,请选择“ 自动” 。 选择读写宽限期。

As the data is replicated asynchronously, the immediate failover may result in data loss. So, we must set the grace period accordingly to reduce data loss. The grace period is the time the SQL service waits before triggering automatic failover when an outage occurs.

由于数据是异步复制的,因此即时故障转移可能会导致数据丢失。 因此,我们必须相应地设置宽限期以减少数据丢失。 宽限期是发生中断时SQL服务在触发自动故障转移之前等待的时间。

Add the databases to the group that you want to failover to the secondary and click on Create as shown below.

将数据库添加到要故障转移到辅助数据库的组中,然后单击“ 创建” ,如下所示。

Once the failover group is created and the seeding of the databases is done, two endpoints are created. One with the provided failover group name which is read-write listener endpoint and it always points to the current primary server in the Azure SQL Server failover group. The other one is a read-only listener endpoint which always points to the secondary server in the failover group.

创建故障转移组并完成数据库播种后,将创建两个端点。 具有提供的故障转移组名称的一个,该名称是读写侦听器终结点,并且始终指向Azure SQL Server故障转移组中的当前主服务器。 另一个是只读的侦听器端点,该端点始终指向故障转移组中的辅助服务器。

To know the endpoints, navigate to failover groups and click on the name of the failover group. Under the map, you can see the primary, secondary server details, and the read-write, read-only listener endpoints.

要了解端点,请导航至故障转移组,然后单击故障转移组的名称。 在该图下,您可以看到主要,辅助服务器详细信息以及读写,只读侦听器端点。

手动故障转移 (Manual Failover)

To do a manual failover, navigate to failover groups and click on the name of the failover group. In failover group details page click on failover as shown in the below image.

要执行手动故障转移,请导航至故障转移组,然后单击故障转移组的名称。 在故障转移组详细信息页面中,单击故障转移,如下图所示。

When a planned failover is imitated, the secondary databases are fully synchronized with Azure SQL primary databases before switching the roles. In this case, there is no data loss.

模仿计划的故障转移后,辅助数据库将在切换角色之前与Azure SQL主数据库完全同步。 在这种情况下,不会丢失数据。

Once the failover is successful, the existing primary becomes secondary and the existing secondary becomes primary. The pointing of read-write and read-only listener endpoints are changed automatically.

一旦故障转移成功,现有的主要节点将成为辅助节点,而现有的辅助节点将成为主要节点。 读写和只读侦听器端点的指向会自动更改。

强制故障转移 (Forced Failover)

In the failover group details page, click on Forced failover to do a manual forced failover which immediately switches the roles without synchronizing with primary. This may result in data loss.

在“故障转移组详细信息”页面中,单击“ 强制故障转移”以执行手动强制故障转移,该操作将立即切换角色而不与主数据库同步。 这可能会导致数据丢失。

将数据库添加到现有故障转移组 (Adding a database to the existing failover group)

We can always add a database of the same Azure SQL Server to an existing failover group. When a new database is added to the existing failover group, it automatically creates a new database in the secondary server with the same name, edition and computes. To add a new database to an existing failover group, Click on the failover group in the Azure SQL Server details page. Click on the failover group name and click on Add databases.

我们始终可以将同一Azure SQL Server的数据库添加到现有故障转移组。 将新数据库添加到现有故障转移组后,它将在辅助服务器中自动创建具有相同名称,版本和计算名称的新数据库。 要将新数据库添加到现有故障转移组,请在“ Azure SQL Server详细信息”页面中单击故障转移组。 单击故障转移组名称,然后单击添加数据库

All the available databases which are not added in any failover group are shown in the list. Select the database you want to add to the failover group and click on Select. One such example is shown below.

列表中显示了未添加到任何故障转移组中的所有可用数据库。 选择要添加到故障转移组的数据库,然后单击“ 选择” 。 下面显示了一个这样的示例。

After selecting the new databases, click on Save to save the changes to the failover group. Please refer to the below image.

选择新数据库后,单击“保存”将更改保存到故障转移组。 请参考下图。

Similarly, to remove databases from an existing failover group, click on Remove databases. Select the databases you want to remove and click on Save.

同样,要从现有故障转移组中删除数据库 ,请点击删除数据库 。 选择要删除的数据库,然后单击“ 保存”。

结论 (Conclusion)

In this article, we explored how to create auto-failover groups in Azure SQL Server and the differences between auto-failover groups and active geo-replication. In case you have any questions, please feel free to ask in the comment section below.

在本文中,我们探讨了如何在Azure SQL Server中创建自动故障转移组以及自动故障转移组与活动地理复制之间的区别。 如果您有任何疑问,请随时在下面的评论部分中提问。

翻译自: https://www.sqlshack.com/azure-sql-server-auto-failover-groups/

sql azure 语法

sql azure 语法_Azure SQL Server自动故障转移组相关推荐

  1. sql azure 语法_Azure SQL Server中的CREATE DATABASE语句概述

    sql azure 语法 In this article, we will review CREATE DATABASE statement in the Azure SQL database wit ...

  2. sql azure 语法_Azure SQL数据同步–在Azure SQL数据库之间复制数据和架构更改

    sql azure 语法 In this article, we will review how to configure the sync group to replicate data betwe ...

  3. sql azure 语法_Azure SQL –使用Azure自动化的索引表

    sql azure 语法 This article provides an overview of indexing tables in Azure SQL database using Azure ...

  4. sql azure 语法_Azure SQL –弹性作业代理

    sql azure 语法 In this article, we will review on elastic job Agent in Azure SQL and how to configure ...

  5. sql azure 语法_Azure Kubernetes服务(AKS)中SQL Server

    sql azure 语法 In this article, we will review how to create a Kubernetes cluster in Azure Kubernetes ...

  6. sql azure 语法_Azure Data Studio中SQL Server Profiler

    sql azure 语法 In this article, we will explore SQL Server Profiler in Azure Data Studio in detail inc ...

  7. sql azure 语法_Azure Data Studio中SQL Server架构比较扩展

    sql azure 语法 This article explores the SQL Server Schema Compare extension in the Azure Data Studio. ...

  8. sql azure 语法_Azure Kubernetes服务(AKS)–管理SQL Server数据库文件

    sql azure 语法 In this article, we will review on managing database files of SQL Server running on Azu ...

  9. sql azure 语法_Azure中的新SQL数据仓库

    sql azure 语法 介绍 (Introduction) In previous chapters, we taught how to create SQL Databases in Azure. ...

最新文章

  1. sybase备份问题
  2. 一个很好的练听力的网站
  3. mysql test 映射到实体_从零搭建SpringBoot+MyBatis+MySQL工程
  4. 30 SD配置-主数据-信用管理-分配交货类型的信贷控制
  5. IOCP扩展方法AcceptEx, DisconnectEx, GetAcceptExSockaddr用法示例
  6. ajax上传文件 基于jquery form表单上传文件
  7. 用c语言写贪吃蛇(简易)(适用初学者)(保姆级)
  8. 三人抢答器逻辑电路图_数字电路3人抢答器实验报告.doc
  9. BXP无盘Windows XP网吧系统的好处(转)
  10. Photometric Stereo 光度立体三维重建(四)——光源标定
  11. SOTA级发丝抠图模型PP-Matting开源,支持多场景精细化分割
  12. U盘中的文件夹被病毒隐藏,生成了同名的.exe后缀的可执行文件
  13. 【DNN,OFDM检测】基于DNN深度学习网络的OFDM信号检测算法的matlab仿真
  14. Paper Reading: Re-ranking Person Re-identification with k-reciprocal Encoding
  15. 人机交互之Web界面设计与CNN大作业
  16. linux下动态库的符号冲突、隐藏和强制优先使用库内符号
  17. juniper SRX55 简单配置
  18. 玩吃鸡用什么蓝牙耳机比较好?内行推荐四款吃鸡低延迟蓝牙耳机
  19. Put GridView inside ScrollView
  20. python中的array是什么意思_python中数组(numpy.array)的基本操作

热门文章

  1. python数据库管理软件_MySQL管理工具MySQL Utilities — 介绍与安装(1)
  2. 如何在input输入框中加一个搜索的小图片_仿淘宝搜索栏
  3. PID控制器开发笔记(转)
  4. LeetCode---binary-tree-inorder-traversal
  5. 03-dotnet core创建区域[Areas]及后台搭建
  6. 链接ftp,把文件或图片上传到ftp指定的文件夹中
  7. Android系统Recovery工作原理之使用update.zip升级过程分析(四)
  8. C++ 学习笔记----基础篇
  9. [Topic]Advanced Run Time Type Identification in C++
  10. thinkphp连接远程数据库慢_干货分享—Niushop数据库配置