SQL Server 2005 Tip #1 - 启动分布式事务协调器 (DTC)

默认情况下,在访问 SQL Server 2005 Express 时使用 System.Transaction.TransactionScope 的情况下,会出现以下错误
MSDTC on server ‘(server name)\SQLEXPRESS’ is unavailable.

原因是 DTC 在默认情况下是被禁用的,需要手动启用。在 Windows XP 和 Windows Vista 下启用的步骤稍有不同,以下是 Vista 下的启用步骤:

 

  1. Click Start, click Run, type dcomcnfg and then click OK to open Component Services.

  2. In the console tree, click to expand Component Services, click to expand Computers, click to expand My Computer, click to expand Distributed Transaction Coordinator and then click Local DTC.

  3. Right click Local DTC and click Properties to display the Local DTC Properties dialog box.

  4. Click the Security tab.

  5. Set the following options on the Security tab of the Local DTC Properties dialog box and click OK.

     

    Configuration Option Default Value Recommended Value

    Network DTC Access

    Disabled

    Enabled

    Client and Administration

       

    Allow Remote Clients

    Disabled

    Disabled

    Allow Remote Administration

    Disabled

    Disabled

    Transaction Manager Communication

       

    Allow Inbound

    Disabled

    Enabled

    Allow Outbound

    Disabled

    Enabled

    Mutual Authentication Required

    Enabled

    Enabled if all remote machines are running Win2K3 SP1 or XP SP2 or higher.

    Incoming Caller Authentication Required

    Disabled

    Enabled if running MSDTC on cluster.

    No Authentication Required

    Disabled

    Enabled if remote machines are pre-Windows Server 2003 SP1 or pre- Windows XP SP2.

    Enable TIP

    Disabled

    Enabled if running the BAM Portal.

    Enable XA Transactions

    Disabled

    Enabled if communicating with an XA based transactional system such as when communicating with IBM WebSphere MQ using the MQSeries adapter.

  6. Open the Control Panel, open Windows Firewall, and click Change settings to display Windows Firewall Settings.

  7. Click the Exceptions tab.

  8. Check the box for Distributed Transaction Coordinator and click OK.

 

posted on 2009-06-22 00:33  CsharpStyle  阅读(986)  评论(0编辑  收藏  举报