Usage of Distributed Transaction DTC

Source: Internet
Author: User
Tags odbc connection

Use distributed functions
OpenDataSource
Openquery
OpenRowSet
Processing distributed databases and writingProgramIt is relatively simple, but the configuration of DTC is complicated. Check msdn for evidence.

I wrote a program for simplicity and found that only one company in 10 companies can obtain data. I searched msdn and found that many people encountered problems in configuring DTC.

StudiedArticleAs follows:
I. a. Do not use transactions. Use select statements. Can I perform distributed queries?

B. linkserver cannot operate on the local machine when performing distributed update transactions (that is, it cannot return distributed transactions)

C. DBCC traceon (3604,730 0) -- use tracking to view more detailed error information.

D.download the dtcping.exe package of msbench on two machines and run it according to readme instructions. See error information.
Http://download.microsoft.com/download/complus/msdtc/1.7/nt45/en-us/DTCPing.exe

2. Whether MSDTC is enabled for both machines.

Iii. Whether MSDTC is set correctly.
1. Open the command prompt, Run "net stop MSDTC", and then run "Net start MSDTC ".
2. Go to "Component Service Management Tools ".
3. Browse to "start management tool ".
4. Select "component service ".
A. Expand the "component service" tree and then expand "my computer ".
B. Right-click "my computer" and select "properties ".
C. On the MSDTC tab, make sure the following options are selected: Network DTC Access
Network Management
Network transactions
XA transaction
E. In addition, "DTC Logon account" must be set to "nt authority \ NetworkService ".
5. Click OK ". This will prompt you that "Ms DTC will stop and restart.
All dependent services will be stopped. Please press & apos; yes & apos; continue ". Click "yes" to continue.
6. Click "OK" to close the "my computer" Properties window.

4.
MSDTC depends on rpc. RPC uses port 135 to test whether port 135 is enabled. Is there a firewall? If the firewall is disabled first.
Telnet IP 135
If it is disabled, open it.

5.
For various reasons, sqloledb cannot use distributed transactions and is changed to "msdasql" ODBC connection.
Use RRAS instead of RAS. (control panel -- Management Tools -- remote service manager)
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.

7. Check whether your two servers are in the same domain.
Whether to establish a trusted connection if it is not in the same domain.

8. Upgrade to SP4.

9. Upgrade MDAC to 2.6 or above, preferably 2.8.

10. Install the latest SQL patch: sp3a
& Apos; All patch locations
Http://www.microsoft.com/downloads/details.aspx? Displaylang = ZH-CN & familyid = 9032f608-160a-4537-a2b6-4cb265b80766

& Apos; patch SQL 2000 sp3 to be installed
Http://download.microsoft.com/download/d/d/e/dde427eb-0296-4eac-a47c-d11a66b03816/chs_sql2ksp3.exe

For the above 10 points

I think:
1. environment is important. Step by step
Because it is Win2000 and SQL Server
8. If it is Win2000, upgrade to SP4
9. Upgrade MDAC to 2.6 or above, preferably 2.8.

10. Install the latest SQL patch: sp3a
Two points.

I found that 10 companies could handle up to 9. Only one failed.

2. Tools are very important.
(1) If port 135 is suspected, use a tool to check the port and find that the port is correct.
(2) Under http://download.microsoft.com/download/complus/msdtc/1.7/nt45/en-us/DTCPing.exe
Tool, test, read readme, said by three steps, the first step to verify the name, the second step to verify RPC, the third step DTC, well, I found that the name verification failed,
It is always found that NetBIOS of TCP/IP is disabled, and the name of cough DTC must be specified. He does not need IP. I.

3. The remote computer can only be accessed by IP address, but cannot be accessed by name.
(1) whether the two routes are correct due to the routing configuration problem (VPN connectivity does not mean that the access is successful, the versions are consistent, and the access is allowed without other exceptions ).
(2) check whether the error log DCOM is displayed. If this error occurs, you cannot access it by name.
(3) check whether the NetBIOS of the corresponding TCP/IP is enabled.
(4) A strange one: if a VPN is built, the local mask must be 255.255.255.0. If it is 224,240, it indicates that the distributed transaction cannot be started.
(5) If the two libraries are local, using these functions is invalid.

 

This article from the csdn blog, reproduced please indicate the source: http://blog.csdn.net/liaoxiaohua1981/archive/2008/07/18/2670188.aspx

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.