sql server高可用_SQL Server始终在线可用性组采访问题与解答

sql server高可用

In this article, we will discuss a number of interview questions that you could be asked about the SQL Server Always On Availability Groups feature when attending an interview for the SQL Server database administrator role.

在本文中,我们将讨论有关SQL Server数据库管理员角色的访谈时可能会询问您的有关SQL Server Always On可用性组功能的许多访谈问题。

Being interviewed for a SQL Server Database Administrator position, and now interviewing candidates for that role, questions related to the High Availability and Disaster Recovery solutions in SQL Server take the large weight of the overall interview questions, as it reflects your advanced knowledge and experience in the SQL Server administration field.

正在接受SQL Server数据库管理员职位的面试,现在正在面试该职位的候选人,与SQL Server中的高可用性和灾难恢复解决方案有关的问题在整个面试问题中占了很大比重,因为它反映了您在以下方面的高级知识和经验SQL Server管理字段。

Q1: Why we need to establish a High Availability and Disaster Recovery Plan in large companies?

问题1:为什么我们需要在大型公司中建立高可用性和灾难恢复计划?

The High Availability and Disaster Recovery plan help in making sure that our database servers that host the company’s critical operational data and serve the main company systems will be available for the longest possible time with the least possible downtime.

高可用性和灾难恢复计划有助于确保承载公司关键运营数据并服务于公司主要系统的数据库服务器在尽可能长的时间内,最少的停机时间内可用。

Q2: List five of the High Availability and Disaster Recovery solutions that are available in Microsoft SQL Server.

Q2:列出Microsoft SQL Server中可用的五个高可用性和灾难恢复解决方案。

  • Log Shipping

    日志传送
  • Transactional Replication

    事务复制
  • Database Mirroring

    数据库镜像
  • Always On Failover Cluster

    始终处于故障转移群集
  • SQL Server Always On Availability Groups

    SQL Server始终在线可用性组

Q3: What are the main differences between the SQL Server Always On Failover Cluster and the SQL Server Always On Availability Groups?

Q3:SQL Server始终启用故障转移群集和SQL Server始终启用可用性组之间的主要区别是什么?

  • In the Always On Failover Cluster, the resources such as the storage, the network name, and the virtual IPs, are shared and can be owned only by one of the cluster nodes at a given time

    在Always On故障转移群集中,存储,网络名称和虚拟IP等资源是共享的,并且在给定时间只能由群集节点之一拥有

But in the Always On Availability Groups, each node will have its own resources, with no resource sharing concept

但是在Always On可用性组中,每个节点将拥有自己的资源,没有资源共享的概念

  • In the Always On Failover Cluster, there is no option to read from the secondary server, as there are no database copies hosted in these secondary nodes

    在Always On故障转移群集中,没有选择要从辅助服务器读取的选项,因为这些辅助节点中没有托管数据库副本

But the Always On Availability Groups supports up to eight secondary replicas, from where you can easily perform read operations or route the read-only workload

但是Always On可用性组最多支持八个辅助副本,从中您可以轻松地执行读取操作或路由只读工作负载

  • Always On Failover Cluster can be used as a High Availability solution only, but the Always On Availability Groups can be used as a High Availability and Disaster Recovery solution

    Always On故障转移群集只能用作高可用性解决方案,而Always On可用性组可以用作高可用性和灾难恢复解决方案
  • The Always On Failover Cluster is configured at the instance level and the failover is performed at the instance level

    Always On故障转移群集是在实例级别配置的,而故障转移是在实例级别执行的

But the Always On Availability Groups is configured at the database level and the failover is performed at the databases group level

但是Always On可用性组是在数据库级别配置的,而故障转移是在数据库组级别执行的

Q4: What are the differences between the SQL Server Database Mirroring and the SQL Server Always On Availability Groups?

Q4:SQL Server数据库镜像和SQL Server Always On可用性组之间有什么区别?

  • In the Database Mirroring you cannot read from the secondary database, where you can read from the secondary databases in the Always On Availability Groups

    在数据库镜像中,您无法从辅助数据库中读取,而在辅助数据库中可以从Always On可用性组中的辅助数据库中读取
  • You can configure the mirroring between two servers only, where you can configure up to eight secondary replicas in the Always On Availability Groups

    您只能在两台服务器之间配置镜像,您可以在Always On可用性组中最多配置八个辅助副本。
  • You can perform automatic failover in the Database Mirroring only if there is a witness server configured, but the automatic failover is always possible between the primary and secondary replicas in the Always On Availability Groups

    仅当配置了见证服务器时,才可以在数据库镜像中执行自动故障转移,但是始终可用可用性组中的主副本和辅助副本之间始终可以进行自动故障转移。
  • Database Mirroring is configured for each database separately, and the failover is performed at the database level, where you can configure the Always On Availability Group to involve multiple databases at the same time using a single wizard and perform the failover at the databases group level

    为每个数据库分别配置了数据库镜像,并且故障转移是在数据库级别执行的,您可以在其中使用一个向导将Always On Availability组配置为同时包含多个数据库,并在数据库组级别执行故障转移

Q5: How does the synchronization process performed in the SQL Server Always On Availability Groups between the different replicas?

Q5:如何在不同副本之间SQL Server Always On可用性组中执行同步过程?

  • sends the transaction log record from the primary database to the secondary database 将事务日志记录从主数据库发送到辅助数据库
  • At the secondary side, the transaction logs will be written to the secondary database transaction log file for caching, in order to redo the transactions in the secondary database

    在辅助方面,事务日志将被写入辅助数据库事务日志文件以进行缓存,以便在辅助数据库中重做事务
  • With the asynchronous-commit availability mode, no need for the primary replica to wait for the secondary replica to write transaction log records to disk

    使用异步提交可用性模式,无需主副本等待副副本将事务日志记录写入磁盘

Q6: What is the Availability Group stands for?

Q6:可用性组代表什么?

A group of databases hosted in a SQL Server instance called primary replica that is copied to and synchronized with up to eight servers, called secondary replicas.

SQL Server实例(称为主副本)中承载的一组数据库,可复制到最多8个服务器并与之同步,这些服务器称为辅助副本。

Q7: What are the availability modes that are used in the SQL Server Availability Group to synchronize between the replicas?

Q7:在SQL Server可用性组中用于副本之间同步的可用性模式是什么?

  • Synchronous-commit mode, in which the primary replica will wait until getting confirmation from the secondary replicas, that the logs are written to the database transaction log file before committing that transaction at the primary side
  • 同步提交模式 ,在该模式下 ,主副本将等待直到从辅助副本获得确认,然后才将日志写入数据库事务日志文件,然后再在主端提交该事务
  • Asynchronous-commit mode, in which the primary replica will commit the transaction directly without waiting to receive the confirmation from the secondary replicas that the logs are written to the transaction log file of the secondary database
  • 异步提交模式 ,在该模式下 ,主副本将直接提交事务,而无需等待从辅助副本接收到将日志写入辅助数据库的事务日志文件的确认

Q8: What is the failover process and when will the SQL Server decide to perform failover in the SQL Server Always On Availability Group?

Q8:什么是故障转移过程?SQL Server何时决定在SQL Server Always On可用性组中执行故障转移?

The failover is a process in which the primary role and the secondary role are interchangeable between the availability replicas.

故障转移是一个过程,其中主要角色和次要角色在可用性副本之间可互换。

The failover process will be issued in case of any server-level failure.

如果发生任何服务器级别的故障,将发出故障转移过程。

No failover process will be performed in case of any database issue, such as data loss or database corruption, unless the Database Level Health Detection feature is enabled.

除非启用了数据库级运行状况检测功能,否则在发生任何数据库问题(例如数据丢失或数据库损坏)的情况下,将不会执行故障转移过程。

Q9: What is the Availability Group Listener?

Q9:什么是可用性组侦听器?

A virtual network name that allows the users to connect to the Primary or the secondary replicas.

一个虚拟网络名称,允许用户连接到主副本或辅助副本。

Q10: When defining a Windows Failover Cluster to build an SQL Server Always On Availability Group over it, will we use this cluster option “Add all eligible storage to the cluster”? why?

问题10:在定义Windows故障转移群集以在其上构建SQL Server始终可用组时,我们将使用此群集选项“将所有符合条件的存储添加到群集”吗? 为什么?

No. We need to uncheck the Add all eligible storage to the cluster option.

否。我们需要取消选中“ 将所有符合条件的存储添加到群集”选项。

This is due to the fact that Always On Availability Group feature works based on having dedicated storage for each replica without having shared storage between the replicas.

这是由于“始终在线可用性组”功能基于每个副本具有专用存储而副本之间没有共享存储这一事实而工作。

Q11: What are the quorum configuration modes that are available in Windows Failover Clustering?

Q11:Windows故障转移群集中有哪些仲裁配置模式?

  • Node Majority Quorum configuration mode in the Windows Failover Cluster, with each cluster node, gives one Vote. This option fits a cluster with an odd number of nodes

    Windows故障转移群集中的节点多数仲裁配置模式,每个群集节点都有一个投票。 此选项适合具有奇数个节点的集群
  • Node & Disk Majority Quorum configuration mode in the Windows Failover Cluster, with each cluster node, gives one vote, with an additional vote for the cluster quorum disk. This option fits the clusters with an even number of nodes

    Windows故障转移群集中的“节点和磁盘多数仲裁”配置模式对每个群集节点进行一票表决,并对群集仲裁磁盘进行附加表决。 此选项适合具有偶数节点的集群
  • Node & File Share Majority Quorum configuration mode in the Windows Failover Cluster, with each cluster node, gives one vote, with an additional vote for a shared file

    Windows故障转移群集中的“节点和文件共享多数仲裁”配置模式,每个群集节点都进行一票表决,并为共享文件另外投票
  • No Majority, where the status of the cluster depends completely on the availability of the Quorum disk

    不占多数,群集的状态完全取决于仲裁磁盘的可用性

Q12: Is it considered as a best practice to create a SQL Server Always On Availability Group with two replicas and configure the quorum using Node Majority mode? Why?

问题12:是否将创建具有两个副本SQL Server永远在线可用性组并使用“节点多数”模式配置仲裁是最佳实践? 为什么?

No. with each node has one vote, the cluster will be down when one of the nodes goes down, losing the advantages of the high availability concept.

否,每个节点都有一票表决权,当其中一个节点发生故障时,群集将关闭,从而失去了高可用性概念的优势。

Q13: How could we enable the Always On Availability Group for a specific SQL Server instance?

问题13:如何为特定SQL Server实例启用Always On可用性组?

Using the SQL Server Configuration Manager, expand the SQL Server Services and browse for the SQL Server Database Engine service -> right-click on the service and select the Properties option. Move to the Always On Availability page under the SQL Server Service properties window, check the “Enable Always On Availability Groups” option, then restart the service to take effect.

使用SQL Server配置管理器,展开SQL Server服务并浏览以找到SQL Server数据库引擎服务->右键单击该服务,然后选择“属性”选项。 移至SQL Server服务属性窗口下的Always On可用性页面,选中“ 启用Always On可用性组 ”选项,然后重新启动服务以使其生效。

Q14: List some of the pre-requisites that the SQL Server Engine will check before adding a database to the Availability Group?

Q14:列出将数据库添加到可用性组之前SQL Server引擎将检查的一些先决条件?

  • The database is configured with a Full recovery model

    数据库配置有完全恢复模型
  • A full backup is taken from that database

    从该数据库获取完整备份
  • The database is not participating in another Availability Group

    该数据库未参与另一个可用性组

Q15: What is the backup preference options that are supported in SQL Server Always On Availability Group?

Q15:SQL Server Always On可用性组支持哪些备份首选项?

  • Preferred Secondary

    首选中学
  • Secondary only

    仅中学
  • Primary

  • Any replica

    任何副本

Q16: How many secondary replicas could we configure in SQL Server 2016?

Q16:我们可以在SQL Server 2016中配置多少个辅助副本?

SQL Server 2016 supports up to eight replicas.

SQL Server 2016最多支持八个副本。

Q17: What is the difference between configuring the secondary replica as readable or read-intent only?

Q17:将辅助副本配置为仅可读或读意图有什么区别?

  • The readable secondary allows read-only access to the secondary databases

    可读的辅助数据库允许对辅助数据库的只读访问
  • Read-Intent Only secondary replica allows the secondary server to serve the read-only workload ONLY, where the connection string of the application should explicitly mention the Application Intent=Readonly parameter

    “只读只读”辅助副本允许辅助服务器仅服务于只读工作负载,其中应用程序的连接字符串应显式提及Application Intent = Readonly参数

Q18: What is SQL Server Always On Availability Group Read-Only Routing List?

Q18:什么是SQL Server始终可用性组只读路由列表?

A new option introduced in SQL Server 2014 version, in which the read-only workload will be redirected to the first available secondary replica specified in a predefined routing list, taking into consideration that the application explicitly mentions the Application Intent=Readonly parameter.

考虑到应用程序显式提及Application Intent = Readonly参数,SQL Server 2014版本中引入了一个新选项,其中只读工作负载将重定向到预定义路由列表中指定的第一个可用辅助副本。

Q19: What is the difference between the Direct Seeding and Full Backup and Log Backup initial synchronization processes in Always On Availability Group?

Q19:Always On可用性组中的直接播种,完全备份和日志备份初始同步过程有什么区别?

In the Full backup and log backup method, the initial synchronization between the primary and secondary replicas is performed by taking full and transaction log backups of the primary database to a predefined shared folder then restore it to the secondary replicas.

在完全备份和日志备份方法中,通过将主数据库的完整日志和事务日志备份到预定义的共享文件夹中,然后将其还原到辅助副本,来执行主副本和辅助副本之间的初始同步。

The Direct Seeding method, introduced in SQL Server 2016, the secondary databases will be initialized automatically using Microsoft SQL Server Virtual Device Interface (VDI) backup that is performed to the secondary replica over the network without the need for any network share.

在SQL Server 2016中引入的直接播种方法,将使用Microsoft SQL Server虚拟设备接口(VDI)备份自动初始化辅助数据库,该备份是通过网络对辅助副本执行的,不需要任何网络共享。

Q20: How Could we configure an SQL Server Always On Availability Group with a multi-subnet network?

问题20:如何配置具有多子网网络SQL Server永远在线可用性组?

We need to configure the Availability Group listener with one IP from each subnet.

我们需要为每个子网的一个IP配置可用性组侦听器。

翻译自: https://www.sqlshack.com/sql-server-always-on-availability-groups-interview-questions-answers/

sql server高可用

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

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值