Exercise Always On
Exercise Always On
3. In the User Account Control dialog box, click Yes, and wait for the script to finish.
1. On the Start screen, type Failover. Then start the Failover Cluster Manager app.
o MIA-CLUST1
o MIA-CLUST2
o MIA-CLUST3
4.
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 2 of 12
On the Start screen, type SQL Server. Then start the SQL Server 2014 Configuration
Manager app.
6. In the left pane, click SQL Server Services, in the right pane, double-click SQL Server
(MSSQLSERVER).
7. In the SQL Server (MSSQLSERVER) Properties dialog box, on the AlwaysOn High
Availability tab, verify that AlwaysOn Availability Groups are enabled for the MIA-
CLUSTER failover cluster, and then click Cancel. This setting has been applied to all
the servers in the cluster.
1. Start SQL Server Management Studio and connect to the MIA-CLUST1 database
engine instance using Windows authentication.
3. In the Back Up Database HumanResources dialog box, in the Destination list, click
the existing backup file path, click Remove, and then click Add.
4. In the Select Backup Destination dialog box, in the File name box, type
D:\Labfiles\Lab11\Starter\DataShare\HumanResources.bak, and then click OK.
5. In the Back Up Database HumanResources dialog box, in the Backup type list,
ensure that Full is selected, and then click OK.
6. In the Microsoft SQL Server Management Studio dialog box, click OK.
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 3 of 12
2. In the New Availability Group wizard, on the Introduction page, click Next.
3. On the Specify Availability Group Name page, in the Availability group name box,
type MIA- SQL-AG, and then click Next.
4. On the Select Databases page, select the HumanResources and ResellerSales database
check boxes, and then click Next.
5. On the Specify Replicas page, on the Replicas tab, click Add Replica.
6. In the Connect to Server dialog box, in the Server name box, type MIA-CLUST2, in
the Authentication list, ensure Windows Authentication is selected, and then click
Connect.
8. On the Replicas tab, select the Automatic Failover check box for MIA-CLUST1 and
MIA-CLUST2. This automatically selects the Synchronous Commit check box for
these replicas.
9. On the Replicas tab, in the Readable Secondary list for MIA-CLUST2, click Read-
intent only.
10. On the Replicas tab, in the Readable Secondary list for MIA-CLUST3, click Yes.
11. Review the default settings on the Endpoints and Backup Preferences tabs, and then
click the Listener tab.
12. Click Create an availability group listener, and then specify the following settings:
o Port: 1433
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 4 of 12
13. Click Add, and in the Add IP Address dialog box, in the IPv4 Address box, type
10.10.0.40, and then click OK.
Note: If Add is not visible, you may need to maximize the dialog box or increase
the screen resolution of the virtual machine).
15. On the Select Initial Data Synchronization page, ensure that Full is selected.
16. In the Specify a shared network location accessible by all replicas box, type \\MIA-
CLUST1\DataShare, and then click Next.
17. On the Validation page, review the validation results, and then click Next.
19. On the Results page, you may see a warning about the cluster quorum. This will not
affect the lab. If you do see this warning, review it, and then click Close.
3. Wait for the dashboard to connect to the availability group, and then review the status
information. In the Availability replica table, note that the replicas MIA-CLUST1 and
MIA-CLUST2 should show as Synchronized and MIA-CLUST3 should show as
Synchronizing.
4. Minimize SQL Server Management Studio. You will use it again in a later exercise.
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 5 of 12
1. In the lower-left corner of the task bar, click Start, type cmd, and then click Command
Prompt.
2. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-SQL-CLUST availability group listener, and then press Enter:
sqlcmd -E -S MIA-SQL-CLUST
3. At the command prompt, type the following commands to verify that the SQLCMD
session is connected to the primary replica (MIA-CLUST1):
SELECT @@ServerName
GO
4. At the command prompt, type the following commands to retrieve rows from the
Employee table in the HumanResources database, and then view the results:
5. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:
Exit
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 6 of 12
1. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-CLUST3 replica, and then press Enter:
sqlcmd -E -S MIA-CLUST3
2. At the command prompt, type the following commands to retrieve rows from the
Employee table in the HumanResources database, and then view the results:
3. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:
Exit
1. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-CLUST2 replica, and then press Enter:
sqlcmd -E -S MIA-CLUST2
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 7 of 12
2. At the command prompt, type the following commands to attempt to retrieve rows from
the Employee table in the HumanResources database:
4. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:
Exit
5. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-CLUST2 replica with a read-intent connection, and then press Enter:
6. At the command prompt, type the following commands to attempt to retrieve rows from
the Employee table in the HumanResources database, and then view the results:
7. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:
Exit
8. Minimize the command prompt window. You will use it again in the next exercise.
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 8 of 12
1. Maximize SQL Server Management Studio and view the dashboard for the MIA-SQL-
AG availability group.
4. On the Select New Primary Replica page, select the MIA-CLUST2 check box, and
then click Next.
10. In the dashboard, note that the primary instance is now MIA-CLUST2 and that MIA-
CLUST1 is a secondary replica.
12. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-SQL-CLUST availability group listener, and then press Enter:
sqlcmd -E -S MIA-SQL-CLUST
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 9 of 12
13. At the command prompt, type the following commands to verify that the SQLCMD
session is connected to the new primary replica (MIA-CLUST2):
SELECT @@ServerName
GO
14. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:
Exit
15. Keep the command prompt open for the next task.
1. On the taskbar, click SQL Server Management Studio, and then in Object Explorer,
click Connect Object Explorer.
2. In the Connect to Server dialog box, in the Server name box, type MIA-CLUST2, in
the Authentication list, ensure Windows Authentication is selected, and then click
Connect.
4. In the Use Account Control dialog box, click Yes, and then in the Microsoft SQL
Server Management Studio dialog box, click Yes.
5. If a second Microsoft SQL Server Management Studio dialog box appears, click Yes.
8. At the command prompt, type the following command to open a SQLCMD session and
connect to the MIA-SQL-CLUST availability group listener, and then press Enter:
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 10 of 12
sqlcmd -E -S MIA-SQL-CLUST
9. At the command prompt, type the following commands to verify that automatic failover
has resulted in MIA-CLUST1 resuming the primary replica role:
SELECT @@ServerName
GO
10. At the command prompt, type the following command to exit the SQLCMD session, and
then press Enter:
Exit
11. Close the command prompt, but leave SQL Server Management Studio open.
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 11 of 12
4. In the Cluster Quorum Information dialog box, review the information, and note that
each of the three nodes in the cluster has one vote.
4. On the Select Quorum Configuration Option page, click the Advanced quorum
configuration and witness selection radio button, and then click Next.
5. On the Select Voting Configuration page, click Select Nodes, clear the MIA-CLUST3
check box, and then click Next.
7. On the Select Quorum Witness page, click the Configure a file share witness radio
button, and then click Next.
8. On the Configure File Share Witness page, in the File Share Path field, type \\MIA-
DC\WitnessShare, and then click Next.
9. On the Confirmation page, click Next, wait for the configuration to complete, and then
click Finish.
10. In SQL Server Management Studio, on the MIA-SQL-AG dashboard, click View
Cluster Quorum Configuration Information.
11. In the Cluster Quorum Information dialog box, review the information, noting that
MIA-CLUST3 does not have a vote and that the file share witness has one vote. Click
Close.
12. Close SQL Server Management Studio, and then close Failover Cluster Manager.
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016
Lab Answer Key: Module 11: AlwaysOn Availability Groups Page 12 of 12
https://skillpipe.com/en-GB/Book/BookPrintView/9aebb618-0e1c-463c-9c47-d581ec... 08-12-2016