|
1 | 1 | ---
|
2 |
| -title: Managed Instance link - Use SSMS to failover database |
| 2 | +title: Failover database with link feature in SSMS |
3 | 3 | titleSuffix: Azure SQL Managed Instance
|
4 |
| -description: This tutorial teaches you how to use Managed Instance link and SSMS to failover database from SQL Server to Azure SQL Managed Instance. |
| 4 | +description: This guide teaches you how to use the SQL Managed Instance link in SQL Server Management Studio (SSMS) to failover database from SQL Server to Azure SQL Managed Instance. |
5 | 5 | services: sql-database
|
6 | 6 | ms.service: sql-managed-instance
|
7 | 7 | ms.subservice: data-movement
|
8 |
| -ms.custom: sqldbrb=1 |
| 8 | +ms.custom: |
9 | 9 | ms.devlang:
|
10 |
| -ms.topic: tutorial |
| 10 | +ms.topic: guide |
11 | 11 | author: sasapopo
|
12 | 12 | ms.author: sasapopo
|
13 | 13 | ms.reviewer: mathoma
|
14 | 14 | ms.date: 03/07/2022
|
15 | 15 | ---
|
16 |
| -# Tutorial: Perform Managed Instance link database failover with SSMS |
| 16 | +# Failover database with link feature in SSMS |
17 | 17 |
|
18 | 18 | [!INCLUDE[appliesto-sqlmi](../includes/appliesto-sqlmi.md)]
|
19 | 19 |
|
20 | 20 | This article teaches you to use the Managed Instance link feature to failover your database from SQL Server to Azure SQL Managed Instance in SQL Server Management Studio (SSMS).
|
21 | 21 |
|
22 |
| -Managed Instance link is in public preview. |
| 22 | +Failing over your database from your SQL Server instance to your SQL Managed Instance breaks the link between the two databases, stopping replication, and leaving both databases in an independent state, both ready for read-write workloads. |
| 23 | + |
| 24 | +Managed Instance link is currently in public preview. |
23 | 25 |
|
24 | 26 | ## Prerequisites
|
25 | 27 |
|
26 |
| -To replicate your databases to Azure SQL Managed Instance, you need the following prerequisites: |
| 28 | +To failover your databases to Azure SQL Managed Instance, you need the following prerequisites: |
27 | 29 |
|
28 | 30 | - An active Azure subscription. If you don't have one, [create a free account](https://azure.microsoft.com/free/).
|
29 | 31 | - [SQL Server 2019](https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2019?filetype=EXE)
|
30 | 32 | - An instance of Azure SQL Managed Instance. [Get started](instance-create-quickstart.md) if you don't have one.
|
31 | 33 | - [SQL Server Management Studio (SSMS) v 18.11 or later](/sql/ssms/download-sql-server-management-studio-ssms).
|
32 | 34 | - Network connectivity between SQL Server and SQL Managed Instance using either [Azure ExpressRoute](../../expressroute/expressroute-howto-circuit-portal-resource-manager.md), [Virtual network peering](../../virtual-network/virtual-network-peering-overview.md), or [VPN gateways](../../vpn-gateway/tutorial-create-gateway-portal.md).
|
| 35 | +- Setup the [link feature and replicated your database to your managed instance in Azure](managed-instance-link-use-ssms-to-replicate-database.md). |
33 | 36 |
|
34 |
| -## Managed Instance link database failover (migration) |
| 37 | +## Failover database |
35 | 38 |
|
36 |
| -Follow the steps described in this section to perform Managed Instance link database failover. |
| 39 | +Use the **Failover database to Managed Instance** wizard in SQL Server Management Studio (SSMS) to failover your database from your instance of SQL Server to your instance of SQL Managed Instance. The wizard takes you through the failing over your database. Once the link is created, your source database gets a read-only replica copy on your target Azure SQL Managed Instance. |
37 | 40 |
|
38 |
| -1. Managed Instance link database failover starts with connecting to SQL Server from SSMS. |
39 |
| - To perform Managed Instance link database failover and migrate database from SQL Server to Managed Instance, open the context menu of the SQL Server database. Then select Azure SQL Managed Instance link and then choose Failover database option. |
| 41 | +> [!CAUTION] |
| 42 | +> If you are performing a planned manual failover, stop the workload on the database hosted on the source SQL Server to allow the replicated database on the SQL Managed Instance to completely catch up and failover without data loss. If you are performing a forced failover, there may be data loss. |
40 | 43 |
|
41 |
| - :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-ssms-database-context-failover-database.png" alt-text="Screenshot showing database's context menu option for database failover."::: |
| 44 | +To failover your database, follow these steps: |
42 | 45 |
|
43 |
| -2. When the wizard starts, click Next. |
| 46 | +1. Open SQL Server Management Studio (SSMS) and connect to your instance of SQL Server. |
| 47 | +1. In **Object Explorer**, right-click your database, hover over **Azure SQL Managed Instance link** and select **Failover database** to open the **Failover database to Managed Instance** wizard: |
44 | 48 |
|
45 |
| - :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-introduction.png" alt-text="Screenshot showing Introduction window."::: |
| 49 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-ssms-database-context-failover-database.png" alt-text="Screenshot showing database's context menu option for database failover."::: |
46 | 50 |
|
47 |
| -3. On the Log in to Azure window, sign-in to your Azure account, select Subscription that is hosting the Managed Instance and click Next. |
| 51 | +1. Select **Next** on the **Introduction** page of the **Failover database to Managed Instance** wizard: |
| 52 | + |
| 53 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-introduction.png" alt-text="Screenshot showing Introduction window."::: |
48 | 54 |
|
49 |
| - :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-login-to-azure.png" alt-text="Screenshot showing Log in to Azure window."::: |
50 | 55 |
|
51 |
| -4. On the Failover type window, select the failover type, fill in the required details and click Next. |
| 56 | +3. On the **Log in to Azure** page, select **Sign-in** to provide your credentials and sign into your Azure account. Select the subscription that is hosting the your SQL Managed Instance and then select **Next**: |
52 | 57 |
|
53 |
| - In regular situations you should choose planned manual failover option and confirm that the workload on SQL Server database is stopped. |
| 58 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-login-to-azure.png" alt-text="Screenshot showing Log in to Azure window."::: |
| 59 | + |
| 60 | +4. On the **Failover type** page, choose the type of failover you're performing and check the box to confirm that you've either stopped the workload for a planned failover, or you understand that there may be data loss for a forced failover. Select **Next**: |
54 | 61 |
|
55 |
| - :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-failover-type.png" alt-text="Screenshot showing Failover Type window."::: |
| 62 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-failover-type.png" alt-text="Screenshot showing Failover Type window."::: |
56 | 63 |
|
57 |
| -> [!NOTE] |
58 |
| -> If you are performing planned manual failover, you should stop the workload on the database hosted on the SQL Server to allow Managed Instance link to completely catch up with the replication, so that failover without data loss is possible. |
| 64 | +1. On the **Clean up (optional)**, choose to drop the availability group if it was created solely for the purpose of migrating your database to Azure and you no longer need the availability group. If you want to keep the availability group, then leave the boxes unchecked. Select **Next**: |
59 | 65 |
|
60 |
| -5. In case Availability Group and Distributed Availability Group were created only for the purpose of Managed Instance link, you can choose to drop these objects on the Clean-up window. Dropping these objects is optional. Click Next. |
61 | 66 |
|
62 |
| - :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-cleanup-optional.png" alt-text="Screenshot showing Cleanup (optional) window."::: |
| 67 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-cleanup-optional.png" alt-text="Screenshot showing Cleanup (optional) window."::: |
63 | 68 |
|
64 |
| -6. In the Summary window, you will be able to review the upcoming process. Optionally you can create the script to save it, or to execute it manually. If everything is as expected and you want to proceed with the Managed Instance link database failover, click Finish. |
| 69 | +1. On the **Summary** page, review the actions that will be performed for your failover. (Optionally) You can also create a script to save and run yourself at a later time. When you're ready to proceed with the failover, select **Finish**: |
65 | 70 |
|
66 |
| - :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-summary.png" alt-text="Screenshot showing Summary window."::: |
| 71 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-summary.png" alt-text="Screenshot showing Summary window."::: |
67 | 72 |
|
68 |
| -7. You will be able to track the progress of the process. |
| 73 | +7. The **Executing actions** page displays the progress of the actions: |
69 | 74 |
|
70 | 75 | :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-executing-actions.png" alt-text="Screenshot showing Executing actions window.":::
|
71 | 76 |
|
72 |
| -8. Once all steps are completed, click Close. |
| 77 | +8. After all steps complete, the **Results** page shows a completed status, with checkmarks next to each successfully completed action. You can now close the window: |
73 | 78 |
|
74 | 79 | :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-results.png" alt-text="Screenshot showing Results window.":::
|
75 | 80 |
|
76 |
| -9. After this, Managed Instance link no longer exists. Both databases on SQL Server and Managed Instance can execute read-write workload and are independent. |
77 |
| - With this step, the migration of the database from SQL Server to Managed Instance is completed. |
| 81 | +## View failed over database |
| 82 | + |
| 83 | +During the failover process, the Managed Instance link is dropped and no longer exists. Both databases on the source SQL Server instance and target SQL Managed Instance can execute a read-write workload, and are completely independent. |
78 | 84 |
|
79 |
| - Database on SQL Server. |
| 85 | +You can validate this by reviewing the database on the source SQL Server: |
80 | 86 |
|
81 |
| - :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-ssms-sql-server-database.png" alt-text="Screenshot showing database on SQL Server in SSMS."::: |
| 87 | +:::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-ssms-sql-server-database.png" alt-text="Screenshot showing database on SQL Server in SSMS."::: |
82 | 88 |
|
83 |
| - Database on Managed Instance. |
| 89 | +And then reviewing the database on the target SQL Managed Instance: |
84 | 90 |
|
85 |
| - :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-ssms-managed-instance-database.png" alt-text="Screenshot showing database on Managed Instance in SSMS."::: |
| 91 | +:::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-ssms-managed-instance-database.png" alt-text="Screenshot showing database on Managed Instance in SSMS."::: |
86 | 92 |
|
87 | 93 | ## Next steps
|
88 | 94 |
|
89 | 95 | For more information about Managed Instance link feature, see the following resources:
|
90 | 96 |
|
91 |
| -- [Managed Instance link feature](./link-feature.md) |
| 97 | +To learn more, see [Link feature in Azure SQL Managed Instance](link-feature.md). |
0 commit comments