【发布时间】:2011-11-20 08:54:59
【问题描述】:
我正在尝试对链接服务器运行 SQL,但出现以下错误:
BEGIN DISTRIBUTED TRANSACTION
SELECT TOP 1 * FROM Sessions
OLE DB provider "SQLNCLI" for linked server "ASILIVE" returned message "No transaction is active.".
Msg 7391, Level 16, State 2, Line 3
The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "ASILIVE" was unable to begin a distributed transaction.
提供者返回两个错误:
错误 #1:
Number: $80040E14
Source: Microsoft OLE DB Provider for SQL Server
Description: OLE DB provider "SQLNCLI" for linked server "ASILIVE" returned message "No transaction is active.".
HelpFile:
HelpContext: $00000000
SQLState: 01000
NativeError: 7412
错误 #2
Number: $80040E14
Source: Microsoft OLE DB Provider for SQL Server
Description: The operation could not be performed because OLE DB provider "SQLNCLI" for linked server "ASILIVE" was unable to begin a distributed transaction.
HelpFile:
HelpContext: $00000000
SQLState: 42000
NativeError: 7391
如何让 Microsoft 偏爱功能而不是安全?
或者,至少,我怎样才能让两个 SQL 服务器相互通信?
相关问题
-
The operation could not be performed because OLE DB provider “SQLNCLI10”...(*链接服务器名称为
(null)) - Distributed transaction error?(使用 Oracle 提供程序)
- Unable to enlist in a distributed transaction with NHibernate(使用休眠)
- Error using distributed transaction in SQL Server 2008 R2(SQL Server 2008 R2,没有答案)
- Distributed Transaction Error Only Through Code(由连接池引起)
- Error performing distributed transaction coordinator in linked server(SQL Server 2008,没有答案)
- Distributed transaction error?(没有接受的答案;只有答案没有帮助)
- How to Insert into remote table using Linked server withint Transaction?(接受的答案无法解决)
我已经做了什么无关紧要,但我还是会发布它。
-
诅咒和发誓。
-
砸东西。
-
检查
SELECT是否可以使用链接服务器:SELECT * FROM ASILive.CustomerManagementSystem.dbo.Users .... (763 row(s) affected) -
Checked that client server can
pingthe remote server:C:\Documents and Settings\avatar>ping asicmstest.contoso.com Pinging asicmstest.contoso.com [10.0.0.40] with 32 bytes of data: Reply from 10.0.0.40: bytes=32 time<1ms TTL=128 Reply from 10.0.0.40: bytes=32 time<1ms TTL=128 Reply from 10.0.0.40: bytes=32 time<1ms TTL=128 Reply from 10.0.0.40: bytes=32 time<1ms TTL=128 Ping statistics for 10.0.0.40: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms -
检查远程服务器是否可以按名称与发起服务器通信:
C:\Documents and Settings\avatar>ping asitestserver.contoso.com Pinging asitestserver.contoso.com [10.0.0.22] with 32 bytes of data: Reply from 10.0.0.22: bytes=32 time<1ms TTL=128 Reply from 10.0.0.22: bytes=32 time<1ms TTL=128 Reply from 10.0.0.22: bytes=32 time<1ms TTL=128 Reply from 10.0.0.22: bytes=32 time<1ms TTL=128 Ping statistics for 10.0.0.22: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 0ms, Maximum = 0ms, Average = 0ms -
Checked that
@@SERVERNAMEmatches the server name on both servers:SELECT @@SERVERNAME, SERVERPROPERTY('MachineName') ------------- ------------- ASITESTSERVER ASITESTSERVER和
SELECT @@SERVERNAME, SERVERPROPERTY('MachineName') ---------- ---------- ASIGROBTEST ASIGROBTEST -
尖叫
-
Issued
SET XACT_ABORT ONbefore issuing my query:SET XACT_ABORT ON GO BEGIN DISTRIBUTED TRANSACTION SELECT TOP 1 * FROM Sessions -
Granted
EveryoneFull Controlto:HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer在两台服务器上。
【问题讨论】:
-
很高兴您没有跳过关键的“诅咒和发誓”步骤!
-
@joelarson 嘿,有时人们对您遵循每一个步骤非常挑剔。我不想让任何人说我没有尝试过。
-
我喜欢这篇文章。它代表了我使用 MSDTC 的所有经历。
-
就我而言,在链接服务器上将“启用 RPC 的分布式事务提升”设置为 False 后,它可以工作。也许试试
-
@HaiPhan 关闭分布式事务的使用会破坏跨国完整性:如果您在本地服务器上回滚更改,则意味着更改将保留在远程服务器上。非常危险。
标签: sql-server sql-server-2005 msdtc distributed-transactions