sqlserver:SQL Server DT问与答

Q: 假设我现在有2台SQL Server (Windows Server 2003 + SQL Server 200 sp3),分别叫DB01和DB02,互相信任,互相把对方加入了Linked Servers的列表,常规访问无任何问题,但是无法启用分布式事务,例子如下:

在DB01上运行下列SQL命令:

begin tran

select top 1 * from item

select top 1 * from db02.production.dbo.item

rollback tran

在第2个select语句处提示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. ]
OLE DB error trace [OLE/DB Provider \'SQLOLEDB\' ITransactionJoin::JoinTransaction returned 0x8004d00a].

把begin tran换成BEGIN DISTRIBUTED TRANSACTION,结果相同。

在这2台服务器上,已经同时启用了MS DTC服务,并在Component Service中设定了MS DTC各种安全支持选项全开(步骤如下:

1. Click Start, point to All Programs, point to Administrative Tools, and click Component Services.
2. In the Component Services console, expand Component Services, expand Computers, right-click My Computer, and then click Properties.
3. In the My Computer Properties dialog box, _disibledevent=9032f608-160a-4537-a2b6-4cb265b80766

\'应该安装的补丁sql 2000 sp3
http://download.microsoft.com/download/d/d/e/dde427eb-0296-4eac-a47c-d11a66b03816/chs_sql2ksp3.exe



本人认为:
1、环境是重要的。

2、工具是很重要的。
(1)怀疑是135端口,就用一个检查端口的工具去看,发觉端口没有问题。
(2)下了http://download.microsoft.com/download/complus/msdtc/1.7/nt45/en-us/DTCPing.exe
工具,测试,看了readme,说由三步,第一步验证名称,第二步验证rpc,第三步dtc,好,我居然发现名字验证都没通过,
总于发现tcp/ip的netbios被关掉了,咳 dtc 居然一定要名称。不用IP. I 服了 he了。

3、出现远地的计算机只能用IP地址访问不能进行名字访问,我碰到如下。
(1)、路由的设置的问题,俩个路由是否确定无误(VPN能连通并不代表名字访问能成功,版本一致,允许芳临访问,无其他异常)。
(2)、是否出现错误日志DCOM,出现此错误也将不能进行名字访问。
(3)、相应tcp/ip的netbios是否打开。


Tags:  sqlserver2008 sqlserver2005 sqlserver2000 sqlserver

延伸阅读

最新评论

发表评论