gpt4 book ai didi

sql-server - 无法开始分布式事务

转载 作者:行者123 更新时间:2023-12-01 16:59:19 27 4
gpt4 key购买 nike

我尝试对链接服务器运行 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 Server 相互通信?

相关问题

<小时/>

我所做的事情无关紧要,但无论如何我都会发布。

  1. 确保分布式事务协调器服务在两台机器上运行:

    enter image description here

    enter image description here

  2. 禁用两台计算机上的所有 MSDTC 安全性:

    enter image description here

    enter image description here

  3. 在链接服务器上启用随机选项:

enter image description here

  • 咒骂发誓。

  • 砸碎东西。

  • 检查 SELECT 是否可以使用链接服务器:

        SELECT * FROM ASILive.CustomerManagementSystem.dbo.Users
    ....

    (763 row(s) affected)
  • Checked that client server can ping the 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 @@SERVERNAME matches the server name on both servers :

       SELECT @@SERVERNAME, SERVERPROPERTY('MachineName')

    ------------- -------------
    ASITESTSERVER ASITESTSERVER

       SELECT @@SERVERNAME, SERVERPROPERTY('MachineName')

    ---------- ----------
    ASIGROBTEST ASIGROBTEST
  • 尖叫

  • Issued SET XACT_ABORT ON before issuing my query :

    SET XACT_ABORT ON
    GO
    BEGIN DISTRIBUTED TRANSACTION
    SELECT TOP 1 * FROM Sessions
  • Granted Everyone Full Control to :

    HKEY_LOCAL_MACHINE\Software\Microsoft\MSSQLServer

    在两台服务器上。

  • 最佳答案

    发现,远程服务器上的MSDTC是本地服务器的克隆。

    来自 Windows 应用程序事件日志:

    Event Type: Error
    Event Source: MSDTC
    Event Category: CM
    Event ID: 4101
    Date: 9/19/2011
    Time: 1:32:59 PM
    User: N/A
    Computer: ASITESTSERVER
    Description:

    The local MS DTC detected that the MS DTC on ASICMSTEST has the same unique identity as the local MS DTC. This means that the two MS DTC will not be able to communicate with each other. This problem typically occurs if one of the systems were cloned using unsupported cloning tools. MS DTC requires that the systems be cloned using supported cloning tools such as SYSPREP. Running 'msdtc -uninstall' and then 'msdtc -install' from the command prompt will fix the problem. Note: Running 'msdtc -uninstall' will result in the system losing all MS DTC configuration information.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    正在运行

    msdtc -uninstall
    msdtc -install

    然后停止并重新启动 SQL Server 服务即可修复该问题。

    关于sql-server - 无法开始分布式事务,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7473508/

    27 4 0
    Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
    广告合作:1813099741@qq.com 6ren.com