2007~2011/Windows Platform2009. 6. 29. 00:01
신규 설치 서버의 MSDTC 분산 트랜잭션 실패 오류가 발생하였습니다. Configuration, 방화벽, DB ... 어디서 문제가 발생한 것일까요? 하나 하나씩 체크하며 확인해 봐야겠죠? 


[환경]
Windows Server 2003 SP2
SQL Server 2005 


[현상]
분산 트랜잭션 쿼리 사용이 실패하여 테스트를 위해 DTCTester 를 실행하였으나 아래와 같은 오류 메시지가 발생합니다. 

D:\dtctester>dtctester SQLTEST sa P@$$w0rd
Executed: dtctester
DSN:  SQLTEST
User Name: sa
Password: P@$$w0rd
tablename= #dtc3600
Creating Temp Table for Testing: #dtc3600
Warning: No Columns in Result Set From Executing: 'create table #dtc3600 (ival int)'
Initializing DTC
Beginning DTC Transaction
Enlisting Connection in Transaction
Error:
SQLSTATE=25S12,Native error=-2147168242,msg='[Microsoft][ODBC SQL Server Driver]
분산 트랜잭션 오류입니다.'
Error:
SQLSTATE=24000,Native error=0,msg=[Microsoft][ODBC SQL Server Driver]잘못된 커서
 상태입니다.
Typical Errors in DTC Output When
a.  Firewall Has Ports Closed
-OR-
b.  Bad WINS/DNS entries
-OR-
c.  Misconfigured network
-OR-
d.  Misconfigured SQL Server machine that has multiple netcards.
Aborting DTC Transaction
Releasing DTC Interface Pointers
Successfully Released pTransaction Pointer.
 

[원인]
MSDTC 제대로 작동하려면 클라이언트 컴퓨터에서 특정 IP (인터넷 프로토콜) 주소와 해당 해당 네트워크 이름을 알고 있어야 합니다. 하지만 양방향 모두 NETBIOS 이름 확인이 실패하였습니다. (MSDTC will use NETBIOS to resolve remote machine name. This means you should be able to resolve remote machine name by NEBIOS name.)


[해결방안]
클라이언트 컴퓨터에 DNS 이름, 호스트 파일 또는 다른 이름 확인 방법을 사용하여 이름 및 IP 주소를 확인할 수 있습니다. Client 와 SQL Server 각각 양방향에 아래 경로에 있는 hosts 파일에 IP와 NETBIOS NAME 을 등록하여 문제가 해결 되었습니다.
C:\WINDOWS\system32\drivers\etc\hosts


[분석결과]
1. 양방향 지점 간 방화벽(application, network) 등록되어 있지 않음 
2. 양방향 DTC 보안 설정이 동일하며 MS 권장사항 대로 설정되어 있습니다 (참고자료 링크 참조) 
3. ODBC 데이터 원본 관리자를 사용하여 SQL 서버 로컬에서는 DTCTester 가 성공합니다. 
4. IP 를 사용한 ping test는 성공하였으나 NETBIOS 이름으로 ping test 실패하였습니다.


[참고자료]
MSDTC RPC COMMUNICATION

Description of names and IP addresses that an MSDTC client in a cluster environment must have

Windows Server 2003 서비스 팩 1 및 Windows XP 서비스 팩 2에 있는 Distributed Transaction Coordinator 서비스의 새 기능

How To Use DTCTester Tool

MS DTC 방화벽 문제를 해결하는 방법

XCLN: RPCPing을 사용하여 RPC 통신을 테스트하는 방법

MSDTC Troubeshooting~


작성자 : Lai Go / 작성일자 : 2009.06.25
Posted by Lai Go