As MSTC is the core Transaction Service, its restarting will cause other Transaction depended services stop working normally, such as SQL server. We already know some possible scenarios that will cause MSDTC restarting and have to perform the operations only when product environment will not be impacted, the scenarios can be:
1. Reinstall MSDTC
2. Reconfigure MSDTC component (Enable Network Access for DTC) in the Add/Remove Windows Component UI
3. Change the MDTC settings configuration in the Component Service UI, when you see the Restarting alert, ensure this is a right time to do so.
4. Failover MSDTC resource in cluster
We experienced one issue before, customer didn’t do any operation as above, but still experienced one MSDTC restarting, which caused SQL service stop working at that period.
We found this situation can happen when the MSDTC was installed before Win2003 SP2 installation, and after some operations in the Add/Remove Windows Component (the sysocmgr.exe) , the MSDTC upgrading will be easily triggered (in our tests, reconfigure the DTCNetworkAccess will make this happen. There could be other operations also causing this).
That’s why we saw this item in C:\WINDOWS\DTCInstall log:
05-19-2009 08:32 : DTC Install error = 00000000, -ws03sp1install, d:\nt\com\complus\dtc\dtc\msdtc\src\msdtc.cpp (784)
05-19-2009 08:32 : DTC Install error = 00000000, Starting MSDTC Service, d:\nt\com\complus\dtc\ntdtcsetup\src\cdtccore.cpp (563)
To confirm this, can check the c:\windows\ntdtcsetup.log, there will be a similar information as below:
DTC Setup[9:58:24]: Start OC_INIT_COMPONENT Component = dtc
DTC Setup[9:58:24]: INF VERSION (dtc) = 2001,12,4720,3959
DTC Setup[9:58:24]: Instantiating CMasterNT5Srv
DTC Setup[9:58:24]: Installed DTC product version = 5.2.3790.1830
DTC Setup[9:58:24]: DTC Installation Mode = UPGRADE
DTC Setup[9:58:24]: DTC Setup Mode = CUSTOM ….
DTC Setup[10:1:8]: Running command: "C:\WINDOWS\system32\msdtc.exe" -install -a -d "C:\WINDOWS\system32" -l "C:\WINDOWS\system32\MSDTC" -silentinstall
DTC Setup[10:1:9]: Running command: "C:\WINDOWS\system32\msdtc.exe" -ws03sp1install
DTC Setup[10:1:11]: Starting service MSDTC.
In short, on Windows 2003, if we installed MSDTC before installing Windows SP2, the MSDTC will not be updated immediately. The MSDTC update will happen when we change some Windows Components in the Add/Remove Windows Component later. The implicit MSDTC restarting will happen at the same time.
To avoid this problem, we can explicitly manually add/remove the “Enable Network Access for DTC” option in the Add/Remove Windows Component first while the system in idle status after installing SP2, this can upgrade MSDTC and restarting it. After that, the implicit MSDTC upgrading and restarting will not happen again.
With further research, the similar issue may also happen if MSDTC was installed before Windows 2003 SP1 installation (MSDTC needs to be upgraded from SP0 to SP1 sooner or later):
926839 The SQL Server service stops when you run the Add/Remove Windows Components wizard on a new installation of Windows Server 2003 SP1
Note: it uses a registry key to stop the implicit MSDTC upgrading, but in my opinion, manually trigger the MSDTC upgrading by add/remove the “Enable Network Access for DTC” option in the Add/Remove Windows Component after installing Windows patch will be better as this MSDTC update only happens once.