Chat now with support
与支持团队交流

Active Roles 7.3.3 - Replication: Best Practices and Troubleshooting

Solution

Solution

By using SQL Server Enterprise Manager or SQL Server Management Studio, verify that the Replication Agent credentials are set properly. The following conditions must be met:

 

Table 2: Conditions for Replication Agent credentials

Server role

Authentication mode

Replication Agent credentials

Publisher

 

Windows Authentication

Impersonate the SQL Server Agent account on the computer running the Publisher SQL Server (trusted connection)

SQL Server Authentication

SQL Server login and password that the Publisher Administration Service uses to connect to its SQL Server

Subscriber

 

Windows Authentication

Impersonate the SQL Server Agent account on the computer running the Publisher SQL Server (trusted connection)

SQL Server Authentication

SQL Server login and password that the Subscriber Administration Service uses to connect to its SQL Server

For information on how to view or modify the credentials that the Snapshot Agent and Merge Agents use to connect to the Publisher and Subscribers, see Modifying Replication Agent credentials earlier in this document.

SQL Server identification problems

SQL Server identification problems

Symptoms

When promoting SQL Server to Publisher, or adding it as a Subscriber to the existing Publisher, the operation fails with the following error: “An alias cannot be used for replication. Use the name of the SQL Server instance.”

Solution

Solution

This error may be due to one of the following reasons:

  • Incorrect server name. The computer running SQL Server is renamed, or SQL Server has lost its name.
  • Administration Service identifies SQL Server by alias. An alias was used to specify SQL Server when installing the Administration Service.
Incorrect server name

To isolate and resolve this problem, run the following two queries on the SQL Server instance affected by this issue. Copy these queries “as is,” without making any substitutions for the servername parameter:

select @@servername

select serverproperty('servername')

If select @@servername returns a non-null value that is different from the value returned by the second query, execute the following SQL script:

exec sp_dropserver 'oldname', 'droplogins'

exec sp_addserver 'newname', 'local'

In this script, replace:

  • oldname with the value returned by select @@servername
  • newname with the value returned by select serverproperty('servername')

If select @@servername returns NULL, execute the following SQL script:

exec sp_addserver 'newname', 'local'

In this script, replace newname with the value returned by select serverproperty('servername').

For these changes to take effect, you must restart SQL Server. You can restart SQL Server by using SQL Server Configuration Manager:

  1. In the console tree, select SQL Server Services.
  2. In the details pane, right-click the SQL Server instance to restart, and then click Restart.
Administration Service identifies SQL Server by alias

The Administration Service must be configured to identify SQL Server by computer name, rather than using a client alias. Otherwise, when attempting to make SQL Server the Publisher or a Subscriber, you encounter the error “An alias cannot be used for replication. Use the name of the SQL Server instance.”

To avoid this problem, you may need to reinstall the Administration Service. When installing the Administration Service, use the following syntax to identify SQL Server:

  • computername — for the default instance
  • computername\instancename — for a named instance

In this syntax:

  • computername is the (short) NetBIOS name of the computer running SQL Server;
  • instancename is the name of a SQL Server named instance.

 

 

相关文档