正解:
See the explanation part for the complete Solution.
Explanation:
To configure a disaster recovery solution for db1, you can use the failover groups feature of Azure SQL Database. Failover groups allow you to manage the replication and failover of a group of databases across different regions with the same connection strings1. You can also use active geo-replication as an alternative, but you will need to update the connection strings manually after a failover2.
Here are the steps to create a failover group for db1 with the secondary server in the West US 3 region:
* Using the Azure portal:
* Go to the Azure portal and select your Azure SQL Database server that hosts db1.
* Select Failover groups in the left menu and click on Add group.
* Enter a name for the failover group and select West US 3 as the secondary region.
* Click on Create a new server and enter the details for the secondary server, such as server name, admin login, password, and subscription.
* Click on Select existing database(s) and choose db1 from the list of databases on the primary server.
* Click on Configure failover policy and select the failover mode, grace period, and read-write
* failover endpoint mode according to your preferences.
* Click on Create to create the failover group and start the replication of db1 to the secondary server.
* Using PowerShell commands:
* Install the Azure PowerShell module and log in with your Azure account.
* Run the following command to create a new server in the West US 3 region: New-AzSqlServer
-ResourceGroupName <your-resource-group-name> -ServerName
<your-secondary-server-name> -Location "West US 3" -SqlAdministratorCredentials
$(New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList
"<your-admin-login>", $(ConvertTo-SecureString -String "<your-password>" -AsPlainText
-Force))
* Run the following command to create a new failover group with
db1: New-AzSqlDatabaseFailoverGroup -ResourceGroupName <your-resource-group-name>
-ServerName <your-primary-server-name> -PartnerResourceGroupName
<your-resource-group-name> -PartnerServerName <your-secondary-server-name>
-FailoverGroupName <your-failover-group-name> -Database db1 -FailoverPolicy Manual
-GracePeriodWithDataLossHours 1 -ReadWriteFailoverEndpoint "Enabled"
* You can modify the parameters of the command according to your preferences, such as the failover policy, grace period, and read-write failover endpoint mode.
These are the steps to create a failover group for db1 with the secondary server in the West US 3 region.