Skip to content

Commit 894aeb0

Browse files
committed
RFC #14402140: sp_addpullsubscription_agent -subscriber parameter created as node name not listener
1 parent 8766e42 commit 894aeb0

3 files changed

Lines changed: 4 additions & 5 deletions

File tree

docs/database-engine/availability-groups/windows/replication-subscribers-and-always-on-availability-groups-sql-server.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,6 @@ GO
6464

6565
## Creating a Transactional Replication Pull Subscription
6666

67-
> [!NOTE]
68-
> When running [sp_addpullsubscription_agent](../relational-databases/system-stored-procedures/sp-addpullsubscription-agent-transact-sql.md) for a subscriber that is part of an Always On Availability group, you need to pass the *@subscriber parameter* as the AG listener. If you are running SQL 2016 and earlier versions, or SQL 2017 prior to CU16, the SP will execute properly but the **-Subscriber** parameter on the Distribution Agent job will not reference the listener as expected; it will be created using the subscriber server name on which the command is executed. To amend this issue, manually update the [Distribution Agent job](../relational-databases/replication/agents/replication-distribution-agent.md) parameter to the desired listener value.
69-
7067
```
7168
-- commands to execute at the subscriber, in the subscriber database:
7269
use [<subscriber database name>]
@@ -84,6 +81,8 @@ EXEC sp_addpullsubscription_agent
8481
@job_login = null, @job_password = null, @subscriber_security_mode = 1;
8582
GO
8683
```
84+
> [!NOTE]
85+
> When running [sp_addpullsubscription_agent](../../../relational-databases/system-stored-procedures/sp-addpullsubscription-agent-transact-sql.md) for a subscriber that is part of an Always On Availability Group, it is necessary to pass the **@Subscriber** parameter value to the stored procedure as the AG Listener name. If you are running [!INCLUDE[sssql15-md](../../../includes/sssql16-md.md)] and earlier versions, or [!INCLUDE[sssql17-md](../../../includes/sssql17-md.md)] prior to CU16, the stored procedure will not reference the AG Listener name; it will be created with the subscriber server name on which the command is executed. To amend this issue, manually update the **Subscriber** parameter on the [Distribution Agent job](../../../relational-databases/replication/agents/replication-distribution-agent.md) with the AG Listener name value.
8786
8887
## To Resume the Merge Agents After the Availability Group of the Subscriber Fails Over
8988
For merge replication, a replication administrator must manually reconfigure the subscriber with the following steps:

docs/relational-databases/replication/agents/replication-distribution-agent.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ distrib [-?]
8989
Prints all available parameters.
9090

9191
**-Publisher** _server_name_[**\\**_instance_name_]
92-
Is the name of the Publisher. Specify *server_name* for the default instance of [!INCLUDE[msCoName](../../../includes/msconame-md.md)] [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] on that server. Specify _server_name_**\\**_instance_name_ for a named instance of [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] on that server. If your publisher database is in an Always On Availability Group, this will still reflect the original primary publisher server name due to [sp_redirect_publisher](../../system-stored-procedures/sp-redirect-publisher-transact-sql.md) Even if using an Availability Group, the parameter will reflect the original primary publisher node name and not the listener name.
92+
Is the name of the Publisher. Specify *server_name* for the default instance of [!INCLUDE[msCoName](../../../includes/msconame-md.md)] [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] on that server. Specify _server_name_**\\**_instance_name_ for a named instance of [!INCLUDE[ssNoVersion](../../../includes/ssnoversion-md.md)] on that server. If your publisher database is in an Always On Availability Group, this will still reflect the original primary publisher server name due to [sp_redirect_publisher](../../system-stored-procedures/sp-redirect-publisher-transact-sql.md). It will not reflect the AG listener name.
9393

9494
**-PublisherDB** _publisher_database_
9595
Is the name of the Publisher database.

docs/relational-databases/system-stored-procedures/sp-addpullsubscription-agent-transact-sql.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,7 @@ sp_addpullsubscription_agent [ @publisher = ] 'publisher'
9595
Is the name of the Subscriber instance or the name of the AG listener if the subscriber database is in an availability group. *subscriber* is **sysname**, with a default of NULL.
9696

9797
> [!NOTE]
98-
> When running **sp_addpullsubscription_agent** for a subscriber that is part of an Always On Availability group, you need to pass the **@subscriber** parameter as the AG listener. If you are running [!INCLUDE[sssql15-md](../includes/sssql16-md.md)] or earlier versions, or [!INCLUDE[sssql14](../includes/sssql17-md.md)] prior to CU16, the SP will execute properly but the **-Subscriber** parameter on the [Distribution Agent job](../replication/agents/replication-distribution-agent.md) will not reference the listener as expected; it will be created with the subscriber server name on which the command is executed. To amend this issue, manually update the [Distribution Agent job parameter]([Distribution Agent job](../replication/agents/replication-distribution-agent.md#Arguments) with the desired listener value.
98+
> When running **sp_addpullsubscription_agent** for a subscriber that is part of an Always On Availability Group, it is necessary to pass the **@Subscriber** parameter as the AG listener name. If you are running [!INCLUDE[sssql15-md](../../includes/sssql16-md.md)] and earlier versions, or [!INCLUDE[sssql14](../../includes/sssql17-md.md)] prior to CU16, the stored procedure will execute without returning an error but the **@Subscriber** parameter on the [Distribution Agent job](../replication/agents/replication-distribution-agent.md) will not reference the AG Listener name; the parameter will be created with the subscriber server name on which the command is executed. To amend this issue, manually update the Distribution Agent job ([Distribution Agent job](../replication/agents/replication-distribution-agent.md#Arguments) **@Subscriber** parameter with the AG Listener name value.
9999
100100
> [!NOTE]
101101
> This parameter has been deprecated and is maintained for backward compatibility of scripts.

0 commit comments

Comments
 (0)