Skip to content

Latest commit

 

History

History
96 lines (62 loc) · 3.68 KB

File metadata and controls

96 lines (62 loc) · 3.68 KB
title Configure Replication (SSMS)
titleSuffix SQL Server on Linux
description Learn how to configure SQL Server replication on Linux. Configure the replication with either SQL Server Management Studio (SSMS) or Transact-SQL stored procedures.
author rwestMSFT
ms.author randolphwest
ms.reviewer vanto
ms.date 07/03/2025
ms.service sql
ms.subservice linux
ms.topic how-to
ms.custom
linux-related-content
monikerRange >=sql-server-ver15 || >=sql-server-linux-ver15

Configure SQL Server Replication on Linux

[!INCLUDE SQL Server - Linux]

[!INCLUDE SQL Server 2019] introduces SQL Server Replication for instances of SQL Server on Linux.

For detailed information about replication, see SQL Server Replication.

Configure replication on Linux with either SQL Server Management Studio (SSMS) or Transact-SQL stored procedures.

Prerequisites

Before configuring publishers, distributors, and subscribers, you need to complete a couple configuration steps for the SQL Server instance.

  1. Enable SQL Server Agent to use replication agents. On all Linux servers, run the following commands in the terminal.

    sudo /opt/mssql/bin/mssql-conf set sqlagent.enabled true
    sudo systemctl restart mssql-server
  2. Configure the SQL Server instance for replication. To configure the SQL Server instance for replication, run sys.sp_MSrepl_createdatatypemappings on all instances participating in replication.

    USE msdb;
    GO
    
    EXECUTE sys.sp_MSrepl_createdatatypemappings;
    GO
  3. Create a snapshot folder. The SQL Server agents require a snapshot folder to read/write to. Create the snapshot folder on the distributor.

    To create the snapshot folder, and grant access to mssql user, run the following command:

    sudo mkdir /var/opt/mssql/data/ReplData/
    sudo chown mssql /var/opt/mssql/data/ReplData/
    sudo chgrp mssql /var/opt/mssql/data/ReplData/

Configure and monitor replication with SQL Server Management Studio (SSMS)

Configure the distributor

To configure the distributor:

  1. On SSMS connect to your instance of SQL Server in Object Explorer.

  2. Right-click Replication, and select Configure Distribution....

  3. Follow the instructions on the Configure Distribution Wizard.

Create publication and articles

To create a publication and articles:

  1. In Object Explorer, select Replication > Local Publications> New Publication....

  2. Follow the instruction on the New Publication Wizard to configure the type of replication, and the articles that belong to the publication.

Configure the subscription

To configure the subscription in Object Explorer, select Replication > Local Subscriptions> New subscriptions....

Monitor replication jobs

Use Replication Monitor to monitor replication jobs.

In Object Explorer, right-click Replication, and select Launch Replication Monitor.

Related content