Server: Msg 8501, Level 16, State 3, Line 3
MSDTC on server 'servername' is unavailable.
錯誤日誌顯示:ResourceManagerCreationFailed: ResultCode=0x8004d01c
Windows .NET Server (Windows Server 2003 前身) 上,MSDTC (分散式交易協調器) 預設以 Local System 帳戶執行,但 RPC 安全性增強要求 MSDTC 必須以 NT AUTHORITY\NetworkService 執行。
regedt32,瀏覽至 HKEY_LOCAL_MACHINE\Software\Microsoft\MSDTCTurnOffRpcSecurity = 1net stop msdtc
net start msdtc
regedt32HKEY_LOCAL_MACHINE\Software\Microsoft\MSDTC\TurnOffRpcSecurityServer: Msg 7391, Level 16, State 1, Line 2
The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the specified transaction coordinator.]
同樣由「網路 DTC 存取」未啟用或帳戶錯誤導致,套用上述修復即可解決。
-- 故意設為 Local System 觸發錯誤
-- 服務 → 分散式交易協調器 → 登入 → 本地系統 → 重啟服務
-- 執行連結伺服器分散式交易測試
EXEC sp_addlinkedserver 'remote1';
EXEC sp_setnetname 'remote1', '';
GO
EXEC remote1.pubs.dbo.sp_executesql N'CREATE TABLE t (c1 INT)';
GO
SET XACT_ABORT ON;
GO
BEGIN TRAN;
INSERT INTO remote1.pubs.dbo.t VALUES (1);
COMMIT TRAN;
GO
DTC 测试工具 (dtctester.exe) 驗證雙向通訊