Skip to main content Link Menu Expand (external link) Document Search Copy Copied

Task 03: Configure link with SSMS

Introduction

Now that your environment is set up and network connectivity is confirmed, the next step is to create a Managed Instance link. This is crucial for Adatum Corporation’s recently launched eBook store, Adatum Books, to ensure high availability and disaster recovery.

This setup will help Adatum Corporation maintain business continuity and prevent disruptions to their eBook shopping services, ensuring that Adatum Books remain operational even in the event of a failure.

Description

In this task, you’ll create a Managed Instance link. This involves preparing the database for replication, setting up the link using SQL Server Management Studio (SSMS), and verifying that the database is successfully synchronized.

Success criteria

  • You prepared the database for replication.
  • You set up the Managed Instance link using SSMS.
  • You verified that the database was successfully synchronized.

Learning resources

Key tasks

01: Prepare your database

Expand this section to view the solution

With SQL Server as your initial primary, you’ll need to set its Recovery Model to Full, then run a full backup to meet requirements.

  1. In SSMS’s left Object Explorer, right-click the Adatum database, then select Properties

    zso8bqcn.jpg

  2. In the new window, select Options on the left.

    kludh74r.jpg

  3. Select the dropdown next to Recovery model, select Full, then select OK.

    ebr4zi1z.jpg

  4. Right-click the Adatum database again, select Tasks, then select Back Up…

    kpik3f8o.jpg

  5. Backup type should be set to Full, then select OK.

    66tcwb7x.jpg

  6. Select OK on the completion dialog.

The link supports replicating user databases only. Replication of system databases is not supported. To replicate instance-level objects (stored in master or msdb), script them out and run T-SQL scripts on the destination instance.


Expand this section to view the solution

In this task, you’ll use the New Managed Instance link wizard in SSMS to create a link between your initial primary and your secondary replica.

  1. Right-click the Adatum database again, select Azure SQL Managed Instance link, then select New.

    46yxeysg.jpg

  2. On the Introduction page, select Next.

  3. Enter AdatumLink in the Name field, then select Next.

    4m66njcw.jpg

  4. On SQL Server requirements, everything under the Server readiness tab will be Ready.

    5237fxun.jpg

  5. Select the Availability group readiness tab.

  6. If you select the warnings under the Result column, you’ll see that both will automatically be created, so these are safe to ignore.

    7pp3jueg.jpg

    99jfcwd5.jpg

  7. Select Next to proceed.

  8. Select the checkbox next to Adatum, then select Next.

    b6mxrn43.jpg

  9. On Specify Secondary Replica, select Add secondary replica…

    26ug48s7.jpg

  10. Select Sign In…, then sign in with your lab’s Azure credentials:

    Item Value
    Username Your Azure portal username
    Password Your Azure portal password

    If Internet Explorer opens, change your default browser to Edge and try again. Select this box to expand for details.

    1. Select the Windows Start menu.
    2. Enter and select Default apps.
    3. Under Web browser, select Internet Explorer, then select Microsoft Edge.

      yashjp5m.jpg

  11. Once authenticated, close the browser window.

  12. SSMS should automatically select:

    • your Azure subscription name
    • your resource group name
    • the NSG name attached to your MI

    If it does not find the SQL Managed Instance, you may have to restart the Managed Instance from the Azure portal.

  13. Select Sign in…, under Sign in to selected SQL Managed Instance.

  14. Use the following on the Connect to Server window:

    Item Value
    Authentication SQL Server Authentication
    Login MILab
    Password your Azure password (used for SQL/MI authentication
  15. Select Connect.

    bt2wk44c.jpg

  16. Select OK on the Sign in window to close it.

  17. You’ll leave the settings on the Specify Secondary Replica step as is. You can check the other tabs for Endpoints, Backup, and Link Endpoint, then select Next to proceed.

  18. All validation results should show Ready. Select Next.

    jgt7molx.jpg

    If you receive any errors, try selecting Re-run validation near the bottom right.

  19. Select Finish to create the link.

  20. All entries should show Success. Select Close.

    dblw2klz.jpg


03: View the replicated database

Expand this section to view the solution

After the link is created, your database is replicated to the secondary replica. Depending on database size and network speed, the database might initially be in a Restoring… state on the secondary replica. After initial seeding finishes, the database is restored to the secondary replica and ready for read-only workloads.

  1. In SSMS’s Object Explorer, select SQLVM1, then select the refresh icon on the top controls of that pane.

    ss8rhzvg.jpg

  2. In Object Explorer, expand Databases. The Adatum database will now be appended with (Synchronized).

    tzc9fnbe.jpg

  3. In Object Explorer, expand Always On High Availability, then expand Availability Groups to view the distributed availability group for your link.

    bww45t1b.jpg

  4. Right-click AdatumLink (Distributed), then select Show Dashboard.

    llmne1go.jpg

    7b74z6ru.jpg

    You can view the dashboard from either replica, which shows the status of the linked database in the distributed availability group.

  5. Under Availability replica on the dashboard, the Synchronization state column should show:

    • Synchronized for AG_Adatum.
    • Synchronizing for AG_Adatum_MI.

    yvmautkp.jpg


04: Transaction log backup

Expand this section to view the solution

If SQL Server is your initial primary, it’s important to take the first transaction log backup on SQL Server after initial seeding completes, when the database is no longer in the Restoring… state on Azure SQL Managed Instance.

You should take SQL Server transaction log backups regularly to minimize excessive log growth while SQL Server is in the primary role.

  1. In Object Explorer, under Databases, right-click the Adatum (Synchronized) database, select Tasks, then select Back Up….

  2. In the new window, next to Backup type, select Transaction Log from the dropdown.

    te5qxsb6.jpg

  3. Under Destination, select Add….

    gxr8jg0b.jpg

  4. Select the ellipses for File name.

  5. Enter initial_transaction_log for File name, then select OK.

    3yu2fr5a.jpg

  6. Select OK on the Select Backup Destination window.

  7. Feel free to review the other pages for Media Options and Backup Options on the leftmost menu. You’ll leave everything as default in this lab.

  8. Select OK to run the backup.

    zf9dz5lw.jpg

  9. Select OK on the backup completion dialog.


Congratulations! You’ve successfully completed this task.