MS SQL 错误:The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "test" was unable to begin a distributed transact

简介: 一同事在测试服务器(系统:Windows 2008 R2 Standard 数据库:SQL SERVER 2008 R2)通过链接服务器test使用分布式事务测试时出错,出错信息如下: set xact_abort on begin tran update test.

   一同事在测试服务器(系统:Windows 2008 R2 Standard 数据库:SQL SERVER 2008 R2)通过链接服务器test使用分布式事务测试时出错,出错信息如下:

set xact_abort on

begin tran

update test.mydb.dbo.test_one set name='test' where  id= 3 ;

commit

OLE DB provider "SQLNCLI10" for linked server "test" returned message "The transaction manager has disabled its support for remote/network transactions.".

消息 7391,级别 16,状态 2,第 5 行

The operation could not be performed because OLE DB provider "SQLNCLI10" for linked server "test" was unable to begin a distributed transaction.

出现这个错误时因为这台服务器,或者链接服务器那台服务器没有配置好MS DTC(Microsoft Distributed Transaction Coordinator  微软 分布式事务协调器)。

    首先确保开启了 'remote access'、 'remote admin connections'、 'remote proc trans'选项。

Code Snippet
  1. exec sp_configure 'show advanced options',1;
  2.  
  3. go
  4.  
  5. reconfigure;
  6.  
  7. go
  8.  
  9. exec sp_configure 'remote access',1;
  10.  
  11. go
  12.  
  13. reconfigure;
  14.  
  15. go
  16.  
  17. exec sp_configure 'remote admin connections',1;
  18.  
  19. go
  20.  
  21. reconfigure;
  22.  
  23. go
  24.  
  25. exec sp_configure 'remote proc trans',1 ;
  26.  
  27. go
  28.  
  29. reconfigure;
  30.  
  31. go

配置DTC步骤

Step 1:Start(开始)-Control Panel(控制面板)-System and Security(系统和安全)- Administrative Tools(管理工具)-Component Services(组件服务)(或者Run->dcomcnfg 直接跳出组件服务)。

  进入界面点击(Console Root->Componet Services->Computers->My Computer-> Local DTC)

Step 2: 右键单击"Local DTC"的属性,就可以看到“Tracing”、“Logging”、“Security”三个面板。关于设置属性。可以点击下面的“Learn more about setting these properties”

如下所示,一般只用设置“Security”下的属性,具体情况,根据实际情况配置,可以参考下面“本地DTC属性页:“安全选项”卡说明

 

image

注意:如果服务器开启了防火墙,那么必须确保防火墙是否开放了135端口(即允许Distributed Transaction Coordinator程序通过防火墙)

参考资料:

http://blog.csdn.net/wobuwei/article/details/4352792

相关文章
|
3月前
|
SQL IDE Java
Java连接SQL Server数据库的详细操作流程
Java连接SQL Server数据库的详细操作流程
|
2月前
|
SQL 存储 监控
SQL Server的并行实施如何优化?
【7月更文挑战第23天】SQL Server的并行实施如何优化?
56 13
|
2月前
|
SQL
解锁 SQL Server 2022的时间序列数据功能
【7月更文挑战第14天】要解锁SQL Server 2022的时间序列数据功能,可使用`generate_series`函数生成整数序列,例如:`SELECT value FROM generate_series(1, 10)。此外,`date_bucket`函数能按指定间隔(如周)对日期时间值分组,这些工具结合窗口函数和其他时间日期函数,能高效处理和分析时间序列数据。更多信息请参考官方文档和技术资料。
|
2月前
|
SQL 存储 网络安全
关系数据库SQLserver 安装 SQL Server
【7月更文挑战第26天】
44 6
|
1月前
|
SQL 安全 Java
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client
驱动程序无法通过使用安全套接字层(SSL)加密与 SQL Server 建立安全连接。错误:“The server selected protocol version TLS10 is not accepted by client
140 0
|
2月前
|
存储 SQL C++
对比 SQL Server中的VARCHAR(max) 与VARCHAR(n) 数据类型
【7月更文挑战7天】SQL Server 中的 VARCHAR(max) vs VARCHAR(n): - VARCHAR(n) 存储最多 n 个字符(1-8000),适合短文本。 - VARCHAR(max) 可存储约 21 亿个字符,适合大量文本。 - VARCHAR(n) 在处理小数据时性能更好,空间固定。 - VARCHAR(max) 对于大文本更合适,但可能影响性能。 - 选择取决于数据长度预期和业务需求。
|
2月前
|
SQL Oracle 关系型数据库
MySQL、SQL Server和Oracle数据库安装部署教程
数据库的安装部署教程因不同的数据库管理系统(DBMS)而异,以下将以MySQL、SQL Server和Oracle为例,分别概述其安装部署的基本步骤。请注意,由于软件版本和操作系统的不同,具体步骤可能会有所变化。
125 3
|
2月前
|
SQL 存储 安全
数据库数据恢复—SQL Server数据库出现逻辑错误的数据恢复案例
SQL Server数据库数据恢复环境: 某品牌服务器存储中有两组raid5磁盘阵列。操作系统层面跑着SQL Server数据库,SQL Server数据库存放在D盘分区中。 SQL Server数据库故障: 存放SQL Server数据库的D盘分区容量不足,管理员在E盘中生成了一个.ndf的文件并且将数据库路径指向E盘继续使用。数据库继续运行一段时间后出现故障并报错,连接失效,SqlServer数据库无法附加查询。管理员多次尝试恢复数据库数据但是没有成功。
|
2月前
|
SQL 存储 关系型数据库
关系型数据库SQL Server学习
【7月更文挑战第4天】
46 2
|
3月前
|
SQL 存储 测试技术