server info: SQLD01 --configured linked server(SQLP01\WSQLP01), and the connection is okay
SQLP01\WSQLP01 --target instance of the linked server
SQLQ01 --used to test the remotely linked server connection
background: customer complains the linked server on SQLD01 can not connected though remotely server SQLQ01, shows the error as follow
TITLE: Microsoft SQL Server Management Studio
------------------------------
The test connection to the linked server failed.
------------------------------
ADDITIONAL INFORMATION:
An exception occurred while executing a Transact-SQL statement or batch. (Microsoft.SqlServer.ConnectionInfo)
------------------------------
Login failed for user 'NT AUTHORITY\ANONYMOUS LOGON'. (Microsoft SQL Server, Error: 18456)
but we did test that the connection are successful locally(connected on SQLD01), its very strange
This explains a perfect double hop scenario. There are 2 prerequisites for a double hop scenario.
Where we log in to SQLQ01(the remote server) with our credentials and it needs to be passed by SQLD01 to SQLP01\WSQLP01. For this to happen, delegation needs to be enabled for the service account under which the middle tier server (SQLD01) is running,
Then we confirmed that the Delegation has been enabled for this service account on the domain controller– Trust this account for any service (Kerberos only), which is the 2nd option in the Active Directory.
There is one more requirement for double hop scenario. The middle tier server (SQLD01) and destination server (SQLP01\WSQLP01), should be enabled for Kerberos. We check this by executing a query on the server –
select auth_scheme from sys.dm_exec_connections
This query will list all the different authentication protocols in use right now. We should see at least one Kerberos in the list. We could not see that for SQLD01 in the beginning. So we thought there could be a problem of the SPN’s. If the SPN’s aren’t set perfectly under the correct service account, Kerberos will not work and thereby double hop scenario is not possible.
So we checked the SPN’s for the service account VT\sqladmin, we saw that the SPNs are registered fine. Command: setspn -l VT\sqladmin, and we can see the SPN registerred.
We then checked for duplicate SPNs. Command: setspn -x SQLD01
We got to know that the SPNs for SQLD01 were registered under 2 accounts, under VT\sqladmin as well as under the machine account - SQLD01.
We went ahead and deleted the SPNs from the machine account using the commands:
setspn -d MSSQLSvc/SQLD01.corp.vectort.com:1433 SQLD01
setspn -d MSSQLSvc/SQLD01.corp.vectort.com SQLD01
It took some time to do the changes as we have more than one Domain Controller, and it takes time for the changes to reflect on all of them.
Then we restarted SSMS and tried double hop scenario and it worked.
Summary: We did registerred the SPNs before, because the linked server even not works the the local server itself(SQLD01), after we registerred, it works. Later, we tried to start the sqlserver sercice under localsystem account, then it should be the rootcause that there are dumplicate SPNs exist.
Important:
If the SQL Server service is running under the LocalSystem account, we do not have to manually configure an SPN for SQL Server.
The SPN is created automatically when the SQL Server service starts. If the SQL Server service runs under a domain user account, you must manually configure an SPN.
To do so, follow these steps.
The commands we did add the SPNs before
Setspn -A MSSQLSvc/SQLP01.corp.vectort.com:62240 VT\sqladmin
Setspn -A MSSQLSvc/SQLP01.corp.vectort.com:WSQLP01 VT\sqladmin
Setspn -A MSSQLSvc/WSQLD01.corp.vectort.com:1433 VT\sqladmin
Setspn -A MSSQLSvc/WSQLD01.corp.vectort.com VT\sqladmin
MSSQLSERVER| Linked server can not been connected
来源:这里教程网
时间:2026-03-02 11:04:00
作者:
编辑推荐:
下一篇:
相关推荐
-
雷神推出 MIX PRO II 迷你主机:基于 Ultra 200H,玻璃上盖 + ARGB 灯效
2 月 9 日消息,雷神 (THUNDEROBOT) 现已宣布推出基于英
-
制造商 Musnap 推出彩色墨水屏电纸书 Ocean C:支持手写笔、第三方安卓应用
2 月 10 日消息,制造商 Musnap 现已在海外推出一款 Oce
热文推荐
- SQL Server 2008性能故障排查(一)——概论
SQL Server 2008性能故障排查(一)——概论
26-03-02 - sqlserver2008 事务日志文件(.LDF)丢失风险实验
sqlserver2008 事务日志文件(.LDF)丢失风险实验
26-03-02 - 电脑通用串行接口USB接口标准和传输数率,如何才能提高传输速率
电脑通用串行接口USB接口标准和传输数率,如何才能提高传输速率
26-03-02 - 最全电脑主板接口充电基础教程
最全电脑主板接口充电基础教程
26-03-02 - ArcView Spacial Analyst v2.0 1CD
ArcView Spacial Analyst v2.0 1CD
26-03-02 - 关于SQLServer 时间格式化
关于SQLServer 时间格式化
26-03-02 - Transact-SQL 参考_sql_replqueuemonitor
Transact-SQL 参考_sql_replqueuemonitor
26-03-02 - 给台式机电脑插上一个USB无线网卡,上网变得很简单了
给台式机电脑插上一个USB无线网卡,上网变得很简单了
26-03-02 - SQL Server 2008性能故障排查(二)——CPU
SQL Server 2008性能故障排查(二)——CPU
26-03-02 - 使用 FOR XML PATH 、CTE、PIVOT 產生動態欄位統計表
使用 FOR XML PATH 、CTE、PIVOT 產生動態欄位統計表
26-03-02
