使用“新建可用性组”对话框 (SQL Server Management Studio)Use the New Availability Group Dialog Box (SQL Server Management Studio)

适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions) 适用于:Applies to: 是SQL ServerSQL Server(所有支持的版本)yesSQL ServerSQL Server (all supported versions)

本主题包含有关如何使用 SQL Server Management StudioSQL Server Management Studio 的“新建可用性组”对话框在为 Always On 可用性组Always On availability groups 启用的 SQL Server 2019 (15.x)SQL Server 2019 (15.x) 实例上创建 Always On 可用性组的信息。This topic contains information about how to use the New Availability Group dialog box of SQL Server Management StudioSQL Server Management Studio to create an Always On availability group on instances of SQL Server 2019 (15.x)SQL Server 2019 (15.x) that are enabled for Always On 可用性组Always On availability groups. “可用性组” 定义一组用户数据库,这些用户数据库将以支持故障转移的单个单元和一组故障转移伙伴(称作“可用性副本” )的形式进行故障转移。An availability group defines a set of user databases that will fail over as a single unit and a set of failover partners, known as availability replicas, that support failover.

备注

有关可用性组的简介,请参阅 AlwaysOn 可用性组概述 (SQL Server)中通过 PowerShell 创建和配置 AlwaysOn 可用性组。For an introduction to availability groups, see Overview of Always On Availability Groups (SQL Server).

备注

有关创建可用性组的替代方法的信息,请参阅本主题后面的 相关任务For information about alternative ways to create an availability group, see Related Tasks, later in this topic.

先决条件Prerequisites

  • 创建可用性组之前,请先验证承载可用性副本的 SQL ServerSQL Server 实例位于同一 WSFC 故障转移群集内的不同 Windows Server 故障转移群集 (WSFC) 节点上。Before creating an availability group, verify that the instances of SQL ServerSQL Server that host availability replicas reside on different Windows Server Failover Clustering (WSFC) node within the same WSFC failover cluster. 此外,还要验证是否为 Always On 可用性组Always On availability groups 启用了每个服务器实例以及是否满足其他 Always On 可用性组Always On availability groups 先决条件。Also, verify that each of the server instance is enabled for Always On 可用性组Always On availability groups and meets all other Always On 可用性组Always On availability groups prerequisites. 有关详细信息,我们强烈建议你参阅 针对 AlwaysOn 可用性组的先决条件、限制和建议 (SQL Server)For more information, we strongly recommend that you read Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server).

  • 在创建可用性组之前,请确保将承载可用性副本的每个服务器实例拥有一个功能正常的数据库镜像端点。Before you create an availability group, ensure that every server instance that will host an availability replica has a fully functioning database mirroring endpoint. 有关详细信息,请参阅 数据库镜像终结点 (SQL Server)For more information, see The Database Mirroring Endpoint (SQL Server).

  • 为了使用 “新建可用性组” 对话框,您需要知道将承载可用性副本的服务器实例的名称。To use the New Availability Group dialog box, you need to know the names of the server instances that will host availability replicas. 此外,需要知道要添加到新可用性组的任何数据库的名称,并确保这些数据库满足 针对 AlwaysOn 可用性组的先决条件、限制和建议 (SQL Server)Also, you need know the names of any databases that you intend to add to your new availability group, and you need to ensure that these databases meet the availability database prerequisites and restrictions described in Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server). 如果输入无效值,新的可用性组将无法工作。If you enter invalid values, the new availability group will not work.

限制Limitations

“新建可用性组” 对话框不:The New Availability Group dialog box does not:

  • 创建可用性组侦听器。Create an availability group listener.
  • 将辅助副本联接到可用性组。Join secondary replicas to the availability group.
  • 执行初始数据同步。Perform initial data synchronization.

有关这些配置任务的信息,请参阅本话题后面部分的跟进:在创建可用性组之后For information about these configuration tasks, see Follow Up: After Creating an Availability Group, later in this topic.

权限Permissions

需要 sysadmin 固定服务器角色的成员资格,以及 CREATE AVAILABILITY GROUP 服务器权限、ALTER ANY AVAILABILITY GROUP 权限或 CONTROL SERVER 权限。Requires membership in the sysadmin fixed server role and either CREATE AVAILABILITY GROUP server permission, ALTER ANY AVAILABILITY GROUP permission, or CONTROL SERVER permission.

使用“新建可用性组”对话框 (SQL Server Management Studio)Using the New Availability Group Dialog Box (SQL Server Management Studio)

创建可用性组To create an availability group

  1. 在对象资源管理器中,连接到承载主副本的服务器实例,然后单击该服务器名称。In Object Explorer, connect to the server instance that hosts the primary replica, and click the server name.

  2. 展开“Always On 高可用性”节点。Expand the Always On High Availability node.

  3. 右键单击“可用性组”节点,然后选择“新建可用性组”。Right-click the Availability Groups node, and select the New Availability Group command.

  4. 此命令将打开 “新建可用性组” 对话框。This command opens up the New Availability Group dialog box.

  5. 使用 “常规” 页上的 “可用性组名称” 字段,输入新的可用性组的名称。On the General page, use the Availability group name field to enter a name for the new availability group. 此名称必须是有效的 SQL Server 标识符,该标识符在 WSFC 群集的所有可用性组中保持唯一。This name must be a valid SQL Server identifier that is unique across all availability groups in the WSFC cluster. 可用性组名称的最大长度为 128 个字符。The maximum length for an availability group name is 128 characters.

  6. “可用性数据库” 网格中,单击 “添加” ,然后输入希望属于此可用性组的本地数据库的名称。In the Availability Databases grid, click Add and enter the name of a local database that you want to belong to this availability group. 对要添加的每个数据库重复此操作。Repeat this for every database to be added. 单击 “确定” 后,该对话框将验证指定的数据库是否满足属于可用性组的先决条件。When you click OK, the dialog will verify whether your specified database meet the prerequisites for belonging to an availability group. 有关先决条件的详细信息,请参阅 针对 AlwaysOn 可用性组的先决条件、限制和建议 (SQL Server)For information about these prerequisites, see Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server).

  7. “可用性数据库” 网格中,单击 “添加” ,然后输入要承载辅助副本的服务器实例名称。In the Availability Databases grid, click Add and enter the name of a server instance to host a secondary replica. 该对话框将不尝试连接到这些实例。The dialog will not attempt to connect to these instances. 如果指定不正确的服务器名称,将添加辅助副本,但是您将无法连接到该副本。If you specify an incorrect server name, a secondary replica will be added but you will be unable to connect to that replica.

    提示

    如果添加了副本但是无法连接到主机服务器实例,可以删除该副本并添加新副本。If you have added a replica and cannot connect to the host server instance, you can remove the replica and add a new one. 有关详细信息,请参阅将辅助副本从可用性组删除 (SQL Server)将辅助副本添加到可用性组 (SQL Server)For more information, see Remove a Secondary Replica from an Availability Group (SQL Server) and Add a Secondary Replica to an Availability Group (SQL Server).

  8. 在对话框的 “选择页” 窗格中,单击 “备份首选项”On the Select a page pane of the dialog box, click Backup Preferences. 然后,在 “备份首选项” 页上,指定应基于副本角色执行备份的位置并将备份优先级分配给将承载此可用性组的可用性副本的每个服务器实例。Then, on the Backup Preferences page, specify where backups should occur based on replica role and assign backup priorities to each server instances that will host an availability replica for this availability group. 有关详细信息,请参阅可用性组属性面板:新建可用性组(“备份首选项”页)For more information, see Availability Group Properties: New Availability Group (Backup Preferences Page).

  9. 若要创建可用性组,请单击 “确定”To create the availability group, click OK. 这将导致对话框验证指定的数据库是否满足先决条件的要求。This causes the dialog to verify whether that specified databases meet the prerequisites.

    要退出对话框而不创建可用性组,请单击 “取消”To exit the dialog box without creating the availability group, click Cancel.

跟进:在使用“新建可用性组”对话框创建可用性组之后Follow Up: After Using the New Availability Group Dialog Box to Create an Availability Group

配置可用性组和副本属性To configure availability group and replica properties

完成可用性组配置To complete availability group configuration

用于创建可用性组的其他方法Alternative ways to create an availability group

启用 AlwaysOn 可用性组To enable Always On Availability Groups

配置数据库镜像端点To configure a database mirroring endpoint

解决 AlwaysOn 可用性组配置问题To troubleshoot Always On Availability Groups configuration

另请参阅See Also

AlwaysOn 可用性组概述 (SQL Server) Overview of Always On Availability Groups (SQL Server)
数据库镜像终结点 (SQL Server) The Database Mirroring Endpoint (SQL Server)
可用性组侦听程序、客户端连接和应用程序故障转移 (SQL Server) Availability Group Listeners, Client Connectivity, and Application Failover (SQL Server)
针对 AlwaysOn 可用性组的先决条件、限制和建议 (SQL Server)Prerequisites, Restrictions, and Recommendations for Always On Availability Groups (SQL Server)