Microsoft KB Archive/919034

= FIX: The size of DTC log file cannot be changed in Microsoft Windows Server 2003 SP1 =

Article ID: 919034

Article Last Modified on 3/21/2007

-

APPLIES TO


 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003 Service Pack 1
 * Microsoft Windows Server 2003, 64-Bit Datacenter Edition
 * Microsoft Windows Server 2003, Enterprise x64 Edition
 * Microsoft Windows Server 2003, Datacenter Edition (32-bit x86)
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Windows Server 2003, Standard Edition (32-bit x86)
 * Microsoft Windows Server 2003, Web Edition

-





SYMPTOMS
When you try to change the size of the Microsoft Distributed Transaction Coordinator (DTC) log file in Microsoft Windows Server 2003, the size of the DTC log file does not change.

Note This problem occurs when you run the DTC in a cluster environment.



CAUSE
This problem occurs because of the way that the DTC handles cluster node names. If the DTC cluster node name contains more than or fewer than 15 characters, the name is read incorrectly and the size of the log file cannot be changed.



WORKAROUND
Important This article contains information about how to modify the registry. Make sure to back up the registry before you modify it. Make sure that you know how to restore the registry if a problem occurs. For more information about how to back up, restore, and modify the registry, click the following article number to view the article in the Microsoft Knowledge Base:

256986 Description of the Microsoft Windows registry

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

To work around this problem, create a new script file to change the DTC log file size value in the Microsoft Windows registry:  Click Start, point to All Programs, point to Accessories, and then click Notepad.  In the Notepad window, add the following code: '========================================================================== ' ' NAME: SetMSDTCLogSize2003Cluster.vbs ' ' AUTHOR: Mark D. MacLachlan, Microsoft ' DATE : 6/20/2006 ' '   This code is copyright (c) 2006 Microsoft Corporation. ' '   All rights reserved. ' '   THIS CODE AND INFORMATION IS PROVIDED &quot;AS IS&quot; WITHOUT WARRANTY OF '    ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED To '    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A '    PARTICULAR PURPOSE. ' '   IN NO EVENT SHALL MICROSOFT AND/OR ITS RESPECTIVE SUPPLIERS BE '    LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY '   DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, '   WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS '   ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE '   OF THIS CODE OR INFORMATION. ' ' COMMENT: Sets the MSDTC log size in clustered 2003 servers. ' '==========================================================================

On Error Resume Next Const HKEY_LOCAL_MACHINE = &H80000002 Set WSHShell = Wscript.CreateObject(&quot;WScript.Shell&quot;) Set oReg=GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!\\&quot; &_ &quot;.\root\default:StdRegProv&quot;)

NewLogSize = GetLogSize

Set StdOut = WScript.StdOut strKeyPath = &quot;Cluster\Resources\&quot; oReg.EnumKey HKEY_LOCAL_MACHINE, strKeyPath, arrSubKeys

For Each subkey In arrSubKeys Key = WSHShell.RegRead(&quot;HKLM\&quot; & strKeyPath & subkey & &quot;\Name&quot;) If Trim(Key) = &quot;ms dtc&quot; Then MSDTCGUID = strKeyPath & subkey & &quot;\&quot; End If    Err.Clear Key = vbNothing Next oReg.EnumKey HKEY_LOCAL_MACHINE, MSDTCGUID, arrSubKeys For Each subkey In arrSubKeys LogSize = WSHShell.RegRead(&quot;HKLM\&quot; & MSDTCGUID & subkey & &quot;\DtcLogSize&quot;) If Err = 0 Then LogLocation = &quot;HKLM\&quot; & MSDTCGUID & subkey & &quot;\DtcLogSize&quot; WSHShell.RegWrite LogLocation, NewLogSize End If Next WScript.Sleep 1000 CurrentLogSize = WSHShell.RegRead(LogLocation)

InformText = &quot;Log Size Set To: &quot; & CurrentLogSize & &quot;MB&quot; &_ vbCrLf & &quot;Click Yes to restart services for the change to take affect.&quot; &_ vbCrLf & &quot;Please be patient, this may take a few minutes.&quot; If Msgbox(InformText, vbYesNo, &quot;Restart Services?&quot;) = vbYes Then MakeItSo Else WScript.Echo &quot;You must execute the following commands for changes to take affect:&quot; &_ vbCrlf & &quot;NET STOP MSDTC&quot; &_ vbCrlf & &quot;MSDTC -RESETLOG&quot; &_ vbCrlf & &quot;NET START MSDTC&quot; End If WScript.Quit Function GetLogSize ExtendedLogSize = InputBox(&quot;Enter New MSDTC Log Size Value (MB)&quot;,&quot;Set New Log Size&quot;) If IsNumeric(ExtendedLogSize) Then GetLogSize = ExtendedLogSize Else GetLogSize End If   End Function

Function MakeItSo 'Stop the MSDTC service. StopMSDTC 'Wait for service to be stopped. While CheckMSDTCStatus <> &quot;Stopped&quot; WScript.Sleep 10 Wend 'Reset the log size. WSHShell.Run (&quot;CMD.EXE /C MSDTC -RESETLOG&quot;) 'Restart the MSDTC service. wscript.sleep 1000 StartMSDTC While CheckMSDTCStatus <> &quot;Running&quot; WScript.Sleep 10 Wend MsgBox &quot;Services Restarted Successfully, New Log Size Is Now Active&quot; End Function

Function StartMSDTC 'Start the MSDTC service. Set objWMIService = GetObject(&quot;winmgmts:&quot; _       & &quot;{impersonationLevel=impersonate}!\\.\root\cimv2&quot;) Set colServiceList = objWMIService.ExecQuery _ (&quot;Select * from Win32_Service where Name='MSDTC'&quot;) For each objService in colServiceList errReturn = objService.StartService Next End Function

Function StopMSDTC 'Stop the MSDTC service. Set objWMIService = GetObject(&quot;winmgmts:&quot; _       & &quot;{impersonationLevel=impersonate}!\\.\root\cimv2&quot;) Set colServiceList = objWMIService.ExecQuery _ (&quot;Select * from Win32_Service where Name='MSDTC'&quot;) For each objService in colServiceList errReturn = objService.StopService Next End Function

Function CheckMSDTCStatus 'Get the MSDTC current status. Set objWMIService = GetObject(&quot;winmgmts:&quot; _       & &quot;{impersonationLevel=impersonate}!\\.\root\cimv2&quot;) Set colRunningServices = objWMIService.ExecQuery _ (&quot;Select * from Win32_Service where Name='MSDTC'&quot;) For Each objService in colRunningServices CheckMSDTCStatus = objService.State Next End Function  On the File menu, click Save As. Click Desktop, type ChangeMSDTCLogSize.vbs in the File name box, and then click Save.

A new script file that is named ChangeMSDTCLogSize.vbs is created on the Windows desktop. Minimize all open windows, and then double-click ChangeMSDTCLogSize.vbs.

The ChangeMSDTCLogSize.vbs script is started. When you are prompted, type 5, and then click OK.

In this example, the size of the DTC log file is changed to 5 MB. You can enter any numeric value that you want.</li> Click Yes to restart the MSDTC service and enable the new log file size.</li></ol>

<div class="resolution_section">

Service pack information
To resolve this problem, obtain the latest service pack for Windows Server 2003. For more information, click the following article number to view the article in the Microsoft Knowledge Base:

889100 How to obtain the latest service pack for Windows Server 2003

Prerequisites
You must have Windows Server 2003 Service Pack 1 (SP1) installed.

Restart requirement
You must restart your computer after you apply this hotfix.

Hotfix replacement information
This hotfix does not replace a previously released hotfix.

Hotfix file information
After the hotfix is installed, the English version of this hotfix has the file attributes, or a later version of the file attributes, that are listed in the following table:

Windows Server 2003, Itanium-based versions
<div class="status_section">

STATUS
Microsoft has confirmed that this is a bug in the Microsoft products that are listed in the &quot;Applies to&quot; section. This problem was first corrected in Windows Server 2003 Service Pack 2.

<div class="moreinformation_section">

Steps to reproduce the problem

 * 1) Click Start, point to Administrative Tools, and then click Component Services.
 * 2) Double-click Component Services, and then double-click Computers.
 * 3) Right-click My Computer, and then click Properties.
 * 4) Click MSDTC.

Note By default, the value of the Capacity setting is 4.
 * 1) Change the value of the Capacity setting to 5, and then click OK.
 * 2) Click Start, point to Administrative Tools, and then click Component Services.
 * 3) Double-click Component Services, and then double-click Computers.
 * 4) Right-click My Computer, and then click Properties.
 * 5) Click MSDTC. Notice that the value of the Capacity setting has been reset to 4, and that the size of the C:\mstdtc\msdtc.log log file has not changed.
 * 6) Click OK.

Keywords: kbwinserv2003presp2fix kbqfe kbhotfixserver kbfix KB919034

-

[mailto:TECHNET@MICROSOFT.COM Send feedback to Microsoft]

© Microsoft Corporation. All rights reserved.