You may receive a 7391 error message in SQL Server 2000 when you run a distributed transaction against a linked server after you install Windows Server 2003 or Windows XP Service Pack 2http://support.microsoft.com/default.aspx?scid=kb;en-us;839279

解决方案 »

  1.   

    CAUSE
    This problem occurs because of one or more of the following reasons: • Microsoft Distributed Transaction Coordinator (MSDTC) is disabled for network transactions. 
    • Windows Firewall is enabled on the computer. By default, Windows Firewall blocks the Microsoft Distributed Transaction Coordinator (MSDTC) program.Note This problem may occur even when Windows Firewall is turned off. 
    WORKAROUND
    Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.To work around this problem, follow these steps on the computer that Windows Server 2003 or Windows XP SP2 is installed on:1. Make sure that the Log On As account for the MSDTC service is the Network Service account. To do this, follow these steps:a.  Click Start, and then click Run. 
    b.  In the Run dialog box, type Services.msc, and then click OK. 
    c.  In the Services window, locate the Distributed Transaction Coordinator service under Name in the right pane. 
    d.  Under the Log On As column, see whether the Log On As account is Network Service or Local System. If the Log On As account is Network Service, go to step 2. If the Log On As account is Local System account, continue with these steps. 
    e.  Click Start, and then click Run. 
    f.  In the Run dialog box, type cmd, and then click OK. 
    g.  At the command prompt, type Net stop msdtc to stop the MSDTC service. 
    h.  At the command prompt, type Msdtc –uninstall to remove MSDTC. 
    i.  At the command prompt, type regedit to open Registry Editor. 
    j.  In Registry Editor, locate the following key:HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTCregistry key.Delete this key. 
    k.  Quit Registry Editor. 
    l.  At the command prompt, type Msdtc –install to install MSDTC. 
    m.  At the command prompt, type Net start msdtc to start the MSDTC service.Note that the Log On As account for the MSDTC service is set to Network Service account. 
     
    2. Enable MSDTC to allow the network transaction. To do this, follow these steps: a.  Click Start, and then click Run. 
    b.  In the Run dialog box, type dcomcnfg.exe, and then click OK. 
    c.  In the Component Services window, expand Component Services, expand Computers, and then expand My Computer. 
    d.  Right-click My Computer, and then click Properties. 
    e.  In the My Computer Properties dialog box, click Security Configuration on the MSDTC tab. 
    f.  In the Security Configuration dialog box, click to select the Network DTC Access check box. 
    g.  To allow the distributed transaction to run on this computer from a remote computer, click to select the Allow Inbound check box. 
    h.  To allow the distributed transaction to run on a remote computer from this computer, click to select the Allow Outbound check box. 
    i.  Under the Transaction Manager Communication group, click to select the No Authentication Required option. 
    j.  In the Security Configuration dialog box, click OK. 
    k.  In the My Computer Properties dialog box, click OK. 
     
    3. Configure Windows Firewall to include the MSDTC program and to include port 135 as an exception. To do this, follow these steps: a.  Click Start, and then click Run. 
    b.  In the Run dialog box, type Firewall.cpl, and then click OK 
    c.  In Control Panel, double-click Windows Firewall. 
    d.  In the Windows Firewall dialog box, click Add Program on the Exceptions tab. 
    e.  In the Add a Program dialog box, click the Browse button, and then locate the Msdtc.exe file. By default, the file is stored in the <Installation drive>:\Windows\System32 folder. 
    f.  In the Add a Program dialog box, click OK. 
    g.  In the Windows Firewall dialog box, click to select the msdtc option in the Programs and Services list.  
    h.  Click Add Port on the Exceptions tab. 
    i.  In the Add a Port dialog box, type 135 in the Port number text box, and then click to select the TCP option. 
    j.  In the Add a Port dialog box, type a name for the exception in the Name text box, and then click OK. 
    k.  In the Windows Firewall dialog box, select the name that you used for the exception in step j in the Programs and Services list, and then click OK. 
     MORE INFORMATION
    Steps to reproduce the behavior
    1. Log on to a computer that has Windows Server 2003 or Windows XP SP2 installed. 
    2. Start Query Analyzer. 
    3. Add a remote computer that is running Microsoft SQL Server 2000 as a linked server. To do this, run the following Transact-SQL statement in Query Analyzer:
    EXEC sp_addlinkedserver  '<remote_server>',  N'SQL SERVER'
    GONote Replace remote_server with the name of the computer that must be configured as the linked server. 
    4. Run a distributed transaction between this computer and the remote computer. To do this, run the following Transact-SQL statement in Query Analyzer: 
    SET xact_abort ON
    GO
    USE  pubs
    GO
    BEGIN DISTRIBUTED TRANSACTION
    SELECT  *  FROM <remote_server>.pubs.dbo.authors
    COMMIT TRAN
    GOYou may receive the error message that is mentioned in the "Symptoms" section.  
      

  2.   

    http://expert.csdn.net/Expert/topic/2835/2835706.xml?temp=.1959955
    回复人: j9988(j9988) 一.A.不用事务,关用SELECT 语句.是否可以分布式查询?   B.LINKSERVER 在做分布式更新事务时不能对本机操作.(就是不能环回分布式事务)   C.DBCC TRACEON (3604, 7300)--用跟踪看更详细错误信息.
      
       D.下载MS提供的DTCPing.exe 分装在两台机上,按README说明来运行它.看出错信息.
    http://download.microsoft.com/download/complus/msdtc/1.7/nt45/en-us/DTCPing.exe二.两台机的MSDTC是否都打开了.三.MSDTC设置是否正确.
    1.打开命令提示,运行"net stop msdtc",然后运行"net start msdtc"。
    2.转至"组件服务管理工具"。
    3.浏览至"启动管理工具"。
    4.选择"组件服务"。
     a.展开"组件服务"树,然后展开"我的电脑"。
     b.右键单击"我的电脑",然后选择"属性"。
     C.在 MSDTC 选项卡中,确保选中了下列选项: 网络 DTC 访问
    网络管理
    网络事务
        XA 事务
     e.另外,"DTC 登录帐户"一定要设置为"NT Authority\NetworkService"。
    5.单击"确定"。这样将会提示您"MS DTC 将会停止并重新启动。
      所有的依赖服务将被停止。请按'是'继续"。单击"是"继续。
    6.单击"确定"关闭"我的电脑"属性窗口。四.
    MSDTC依赖于RPC,RPC使用的端口是135,测试135端口是否打开.是否有防火墙?如果有先关了防火墙.
    telnet IP 135
    如果是关闭的打开它.五.
    有的机由于各种原因),SQLOLEDB不能使用分布式事务,更改为"MSDASQL" 的ODBC方式联接.
    使用RRAS而不是RAS.(控制面版--管理工具--远程服务管理器)
    Check whether you are using Remote Access Server (RAS) to access remote servers. If so, make sure that you have implemented Routing RAS (RRAS). Linked server does not work on RAS because RAS allows only one way communication.
    七.检查你的两台服务器是否在同一个域中.
    如果不在同一个域中,是否建立可信任联接.八.如果是WIN2000,升级到SP4九.升级MDAC到2.6以上,最好是2.8.十.要安装SQL的最新补丁: sp3a
    '全部补丁的位置
    http://www.microsoft.com/downloads/details.aspx?displaylang=zh-cn&FamilyID=9032f608-160a-4537-a2b6-4cb265b80766'应该安装的补丁sql 2000 sp3
    http://download.microsoft.com/download/d/d/e/dde427eb-0296-4eac-a47c-d11a66b03816/chs_sql2ksp3.exe
      

  3.   

    谢谢上述面各位,但你们说的我都看过了,
    第一: 我这里两台机器都是 win2000server + mssqlserver2000 , 在组件服务的MSDTC选项卡里没有您说的:
    e.  In the My Computer Properties dialog box, click Security Configuration on the MSDTC tab. 
    f.  In the Security Configuration dialog box, click to select the Network DTC Access check box. 

    .在 MSDTC 选项卡中,确保选中了下列选项: 网络 DTC 访问
    网络管理
    网络事务
        XA 事务
     e.另外,"DTC 登录帐户"一定要设置为"NT Authority\NetworkService"。
    上述四条在win2000 server 的组件服务中的MSDTC选项卡中都没有第二:没有防火墙,没有域,就是A和B两机器在不同网段,如果改成同一网段就没问题;请再帮我想想,谢谢!