|
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 - Azure SQL Managed Instance |
17 | 17 |
|
18 | 18 | [!INCLUDE[appliesto-sqlmi](../includes/appliesto-sqlmi.md)]
|
19 | 19 |
|
20 |
| -Managed Instance link is in preview. |
| 20 | +This article teaches you to use the [Managed Instance link feature](link-feature.md) to failover your database from SQL Server to Azure SQL Managed Instance in SQL Server Management Studio (SSMS). |
21 | 21 |
|
22 |
| -Managed Instance link feature enables you to replicate and optionally migrate your database hosted on SQL Server to Azure SQL Managed Instance. |
| 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, ready for individual read-write workloads. |
23 | 23 |
|
24 |
| -Once Managed Instance link database failover is performed from SSMS, the Managed Instance link is cut. Database hosted on SQL Server will become independent from database on Managed Instance and both databases will be able to perform read-write workload. This tutorial will cover performing Managed Instance link database failover by using latest version of SSMS (v18.11 and newer). |
| 24 | +Before failing over your database, make sure you've [prepared your environment](managed-instance-link-preparation.md) and [configured replication through the link feature](managed-instance-link-use-ssms-to-replicate-database.md). |
25 | 25 |
|
26 |
| -## Managed Instance link database failover (migration) |
| 26 | +Managed Instance link is currently in public preview. |
27 | 27 |
|
28 |
| -Follow the steps described in this section to perform Managed Instance link database failover. |
| 28 | +## Prerequisites |
29 | 29 |
|
30 |
| -1. Managed Instance link database failover starts with connecting to SQL Server from SSMS. |
31 |
| - 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. |
| 30 | +To failover your databases to Azure SQL Managed Instance, you need the following prerequisites: |
32 | 31 |
|
33 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-ssms-database-context-failover-database.png" alt-text="Screenshot showing database's context menu option for database failover."::: |
| 32 | +- An active Azure subscription. If you don't have one, [create a free account](https://azure.microsoft.com/free/). |
| 33 | +- [SQL Server 2019 Enterprise or Developer edition](https://www.microsoft.com/en-us/evalcenter/evaluate-sql-server-2019), starting with [CU15 (15.0.4198.2)](https://support.microsoft.com/topic/kb5008996-cumulative-update-15-for-sql-server-2019-4b6a8ee9-1c61-482d-914f-36e429901fb6). |
| 34 | +- An instance of Azure SQL Managed Instance. [Get started](instance-create-quickstart.md) if you don't have one. |
| 35 | +- [SQL Server Management Studio (SSMS) v18.11.1 or later](/sql/ssms/download-sql-server-management-studio-ssms). |
| 36 | +- [Prepared your environment for replication](managed-instance-link-preparation.md) |
| 37 | +- Setup the [link feature and replicated your database to your managed instance in Azure](managed-instance-link-use-ssms-to-replicate-database.md). |
34 | 38 |
|
35 |
| -2. When the wizard starts, click Next. |
| 39 | +## Failover database |
36 | 40 |
|
37 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-introduction.png" alt-text="Screenshot showing Introduction window."::: |
| 41 | +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, breaking the link between the two instances in the process. |
38 | 42 |
|
39 |
| -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. |
| 43 | +> [!CAUTION] |
| 44 | +> 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 | 45 |
|
41 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-login-to-azure.png" alt-text="Screenshot showing Log in to Azure window."::: |
| 46 | +To failover your database, follow these steps: |
42 | 47 |
|
43 |
| -4. On the Failover type window, select the failover type, fill in the required details and click Next. |
| 48 | +1. Open SQL Server Management Studio (SSMS) and connect to your instance of SQL Server. |
| 49 | +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 | 50 |
|
45 |
| - In regular situations you should choose planned manual failover option and confirm that the workload on SQL Server database is stopped. |
| 51 | + :::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 | 52 |
|
47 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-failover-type.png" alt-text="Screenshot showing Failover Type window."::: |
| 53 | +1. Select **Next** on the **Introduction** page of the **Failover database to Managed Instance** wizard: |
48 | 54 |
|
49 |
| -> [!NOTE] |
50 |
| -> 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. |
| 55 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-introduction.png" alt-text="Screenshot showing Introduction page."::: |
51 | 56 |
|
52 |
| -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. |
53 | 57 |
|
54 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-cleanup-optional.png" alt-text="Screenshot showing Cleanup (optional) window."::: |
| 58 | +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 from the drop-down and then select **Next**: |
55 | 59 |
|
56 |
| -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. |
| 60 | + :::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 page."::: |
57 | 61 |
|
58 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-summary.png" alt-text="Screenshot showing Summary window."::: |
| 62 | +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**: |
59 | 63 |
|
60 |
| -7. You will be able to track the progress of the process. |
| 64 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-failover-type.png" alt-text="Screenshot showing Failover Type page."::: |
61 | 65 |
|
62 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-executing-actions.png" alt-text="Screenshot showing Executing actions window."::: |
| 66 | +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**: |
63 | 67 |
|
64 |
| -8. Once all steps are completed, click Close. |
65 | 68 |
|
66 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-results.png" alt-text="Screenshot showing Results window."::: |
| 69 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-cleanup-optional.png" alt-text="Screenshot showing Cleanup (optional) page."::: |
67 | 70 |
|
68 |
| -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. |
69 |
| - With this step, the migration of the database from SQL Server to Managed Instance is completed. |
| 71 | +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**: |
70 | 72 |
|
71 |
| - Database on SQL Server. |
| 73 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-summary.png" alt-text="Screenshot showing Summary page."::: |
72 | 74 |
|
73 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-ssms-sql-server-database.png" alt-text="Screenshot showing database on SQL Server in SSMS."::: |
| 75 | +7. The **Executing actions** page displays the progress of each action: |
74 | 76 |
|
75 |
| - Database on Managed Instance. |
| 77 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-executing-actions.png" alt-text="Screenshot showing Executing actions page."::: |
76 | 78 |
|
77 |
| - :::image type="content" source="./media/managed-instance-link-ssms/link-failover-ssms-managed-instance-database.png" alt-text="Screenshot showing database on Managed Instance in SSMS."::: |
| 79 | +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: |
| 80 | + |
| 81 | + :::image type="content" source="./media/managed-instance-link-use-ssms-to-failover-database/link-failover-results.png" alt-text="Screenshot showing Results window."::: |
| 82 | + |
| 83 | +## View failed over database |
| 84 | + |
| 85 | +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. |
| 86 | + |
| 87 | +You can validate this by reviewing the database on the SQL Server: |
| 88 | + |
| 89 | +:::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 S Q L Server in S S M S."::: |
| 90 | + |
| 91 | +And then reviewing the database on the SQL Managed Instance: |
| 92 | + |
| 93 | +:::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 S S M S."::: |
78 | 94 |
|
79 | 95 | ## Next steps
|
80 | 96 |
|
81 | 97 | For more information about Managed Instance link feature, see the following resources:
|
82 | 98 |
|
83 |
| -- [Managed Instance link feature](./link-feature.md) |
| 99 | +To learn more, review [Link feature in Azure SQL Managed Instance](link-feature.md). |
0 commit comments