Home > SQL Server Tips > Database Management and Administration > Troubleshooting Distributed Transaction Coordinator errors in SQL Server
SQL Server Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

DATABASE MANAGEMENT AND ADMINISTRATION

Troubleshooting Distributed Transaction Coordinator errors in SQL Server


Roman Rehak, Contributor
08.31.2009
Rating: -3.75- (out of 5)


Expert advice on database administration
Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google


SQL Server's linked server configuration allows you to execute queries or stored procedures and receive data sets from external sources by linking to other SQL Servers and database systems.

The Microsoft Distributed Transaction Coordinator (MSDTC) is used to enforce transactional consistency across these multiple systems. To ensure the feature functions correctly and doesn't fail, it is important to properly configure MSDTC and SQL Server.

If MSDTC is not configured properly, a variation of the following error (7391) will appear:

[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].

Msg 7391, Level 16, State 1, Line 3
The operation could not be performed because the OLE DB provider 'SQLOLEDB' was unable to begin a distributed transaction.

This error can occur if MSDTC is not allowed to access the network, which is the default setting in Windows Server 2003. To enable network access for MSDTC:

  1. Open Control Panel, select Add or Remove Programs, then Add/Remove Windows Components
  2. Select Application Server, click Details, then enable the Network DTC Access as shown in Figure 1 below:

Figure 1
[IMAGE]

  1. Restart both SQL Server and MSDTC services

If the errors continue after MSDTC network access is enabled, check if MSDTC is properly configured for network access . The process is as follows:

  1. Open Administrative Tools, then expand Component Services
  2. Drill down to Computers, My Computer
  3. Right-click My Computer and select Properties
  4. Click the MSDTC tab and choose Security Configuration
  5. Enable the Network DTC Access option as well both sub-options (Allow Remote Clients and Allow Remote Administration)
  6. Under Transaction Manager Communication, enable the following options – Allow Inbound, Allow Outbound and Enable TIP Transactions
  7. In the same section, select the No Authentication Required radio button
  8. Finally, enable the Enable XA Transactions option

The ...


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us    Add to Google



RELATED CONTENT
Microsoft SQL Server Performance Monitoring and Tuning
Using traces in SQL Server Profiler
SQL Server Mailbag: CALs, witnesses and unwanted changes
SQL Server Mailbag: Data restoration and DB property management
Working with IntelliSense in SQL Server 2008 Management Studio
SQL Server Mailbag: Stored procedures, triggers and SSRS reports
Clearing the Windows page file and its effect on server performance
Optimizing SQL Server indexes –- even when they're not your indexes
Performance implications of transaction log autogrowth in SQL Server
The short course on how SQL Server really works
Determining the source of full transaction logs in SQL Server

Database Management and Administration
Using traces in SQL Server Profiler
Meet compliance requirements with improved database security practices
Hardening the network and OS for SQL Server security
Securing the server and database in SQL Server
How SQL Server 2008 components impact SharePoint implementations
Achieving high availability and disaster recovery with SharePoint databases
Clearing the Windows page file and its effect on server performance
Deploying a SQL Server virtual appliance for Microsoft Hyper-V
How to create SQL Server virtual appliances for Hyper-V
Push vs. pull: Configuring SQL Server replication

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
contiguity  (SearchSQLServer.com)
contiguous  (SearchSQLServer.com)
drilldown  (SearchSQLServer.com)
hashing  (SearchSQLServer.com)
hybrid online analytical processing  (SearchSQLServer.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary


screen with the above configuration should look like this:

Figure 2 (Click to enlarge)
[IMAGE]

After making the changes, reboot the SQL Server computer.

Now let's look at the setup for linked servers from SQL Server. When a linked server is set up, by default, outgoing RPC calls are disabled. Since a distributed transaction in some scenarios is executed through a remote procedure call, you may need to change the RPC Out option to True in the Properties section of the linked server setup screen, which is pictured in Figure 3 below.

Figure 3 (Click to enlarge)
[IMAGE]

Furthermore, when running INSERT…EXECUTE on a loopback linked server you may encounter Unable to begin… errors if you are using SQL Server 2005 or earlier.

A loopback linked server is a linked server pointing to itself. This occurs when two databases that resided on different SQL Servers end up on the same server, but the code continues executing as a remote linked server query. In this case, SQL Server attempts a distributed transaction, but since the linked server is not really a remote computer, it fails.

To fix this error, modify the code, removing the server part of the query and referencing the object using the three-part name. For example, change INSERT INTO MyServer.MyDatabase.dbo.MyTable to INSERT INTO MyDatabase.dbo.MyTable. The query will no longer run through MSDTC.

Configuring Microsoft Distributed Transaction Coordinator is complex and the results depend on factors like network setup, firewall configuration, security permissions and the combination and configuration of operating systems involved.

You may encounter different errors related to MSDTC than the ones discussed above. For solutions to these, visit Microsoft's Help and Support center and also check out newsgroups and forums. In addition, you can open a support call with Microsoft PSS.

ABOUT THE AUTHOR:   

[IMAGE]Roman Rehak is a senior database architect at MyWebLink.com in Colchester, Vt. He specializes in SQL Server development, database performance tuning, ADO.NET and writing database tools. Roman also serves as the technical chair for the SQL Server track at the annual DevTeach conferences in Canada and is the president of the Vermont SQL Server User Group.


Rate this Tip
To rate tips, you must be a member of SearchSQLServer.com.
Register now to start rating these tips. Log in if you are already a member.




DISCLAIMER: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.



SQL Server Development - .NET, C#, T-SQL, Visual Basic
HomeNewsTopicsITKnowledge ExchangeTipsAsk the ExpertsMultimediaWhite PapersIT Downloads
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 2005 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts