Archived trace table naming convention

Jun 27, 2013 at 6:04 PM
current table naming is like this: [ASTraceTable_Archive_Friday, April 19, 20139:16:48 AM]

I'd suggest to change to another format like [ASTraceTable_Archive_20130419_091648], that'd be shorter and won't have comma, colon and space.
Developer
Jun 27, 2013 at 9:06 PM
What config file settings did you do to achieve the above table name? There's an undocumented AppendDateToSQLTable setting that I would recommend people avoid sine it will cause you to lose data. How did you get that table name?
Jun 27, 2013 at 9:20 PM
each time the ASTrace service restarted, it will rename current table ASTraceTable to an archived name like these:

ASTraceTable
ASTraceTable_Archive_Friday, March 22, 20132:27:07 PM
ASTraceTable_Archive_Monday, March 25, 201311:08:15 AM
ASTraceTable_Archive_Tuesday, January 15, 20137:58:12 PM
ASTraceTable_Archive_Tuesday, January 15, 20138:21:07 PM
ASTraceTable_Archive_Tuesday, June 18, 201310:01:05 PM
ASTraceTable_Archive_Tuesday, June 18, 201311:11:05 PM
ASTraceTable_Archive_Tuesday, March 19, 201310:14:24 PM

I'm suggesting if we can make the archive table names more query friendly. such as ASTraceTable_Archive_yyyymmdd_hhmmss as an example.
Developer
Jun 28, 2013 at 12:50 PM
Can you copy the contents of your .config file into the thread. I've never seen ASTrace do this. Maybe you discovered some settings I didn't know about.
Jun 28, 2013 at 3:53 PM
I'm surprised you're not aware of archive table naming. I don't think it's about the config but defined in the codes, here is my config file.

<?xml version="1.0"?>
<configuration>
<configSections>
    <sectionGroup name="applicationSettings" type="System.Configuration.ApplicationSettingsGroup, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b
77a5c561934e089">
        <section name="ASTrace.Properties.Settings" type="System.Configuration.ClientSettingsSection, System, Version=2.0.0.0, Culture=neutral, PublicKeyTok
en=b77a5c561934e089" requirePermission="false"/>
    </sectionGroup>
</configSections>
<applicationSettings>
    <ASTrace.Properties.Settings>
        <setting name="AnalysisServerName" serializeAs="String">
            <value>CSBIASHA1</value>
        </setting>
        <setting name="SQLServer" serializeAs="String">
            <value>CSTESTDW</value>
        </setting>
        <setting name="SQLServerDatabase" serializeAs="String">
            <value>ASTrace_CSBIASHA1</value>
        </setting>
        <setting name="TraceTableName" serializeAs="String">
            <value>ASTraceTable</value>
        </setting>
        <setting name="TraceDefinition" serializeAs="String">
            <value>UserActivityTrace.tdf</value>
        </setting>
    </ASTrace.Properties.Settings>
</applicationSettings>
<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
Developer
Jun 29, 2013 at 2:25 AM
Maybe you're using a different version of ASTrace than I am. Can you reproduce this behavior on the newest version of ASTrace?

I know Karan published some source code version (no compiled binary) a year or so ago. Maybe there was something in that code?
Jul 1, 2013 at 3:54 AM
I have difficulty installing the new version. my environment is a windows 2012 server, .NET4.5 enabled, SQL 2012 sp1 installed (if this supposed to be a service, should not depend on SQL though).

Error message:
c:\Program Files\ASTrace2012>InstallUtil.exe ASTrace.exe
Microsoft (R) .NET Framework Installation utility Version 4.0.30319.1
Copyright (c) Microsoft Corporation. All rights reserved.

Exception occurred while initializing the installation:
System.IO.FileLoadException: Could not load file or assembly 'file:///c:\Program
Files\ASTrace2012\ASTrace.exe' or one of its dependencies. Operation is not sup
ported. (Exception from HRESULT: 0x80131515).
Developer
Jul 1, 2013 at 9:16 PM
You've got the assemblyBinding and the supportedRuntime tags in your .config file?

You've got Profiler installed on that server?

You right clicked on the install.bat file and did Run as Administrator?

The old ASTrace service isn't already registered, right?
Jul 4, 2013 at 12:07 AM
Edited Jul 4, 2013 at 12:09 AM
Yes, they are there, we just adjust those instance name, db names.

I installed management tools on the server. sql profiler works fine.

I ran it with elevated administrator. it's a new server, no old ASTrace service.

we used to have a coworker rebuild the ASTrace to support x64 platform and coreflag update:
REM see workaround in http://connect.microsoft.com/SQLServer/feedback/details/483926/cannot-open-server-tracefile-with-sql-server-r2-x64
"C:\Program Files\Microsoft SDKs\Windows\v7.0\Bin\x64\corflags.exe" ASTrace.exe /32BIT+

But this version is new, we thought should not have above issue, right?

I have windows events log for ASTrace crash:

Log Name: Application
Source: .NET Runtime
Date: 7/3/2013 4:52:28 PM
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: CSITBIVH02-04.redmond.corp.microsoft.com
Description:
Application: ASTrace.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
at ASTrace.Trace..ctor()
at ASTrace.Program.Main()

Log Name: Application
Source: Application Error
Date: 7/3/2013 4:52:43 PM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: CSITBIVH02-04.redmond.corp.microsoft.com
Description:
Faulting application name: ASTrace.exe, version: 2.1.0.0, time stamp: 0x51d34222
Faulting module name: KERNELBASE.dll, version: 6.2.9200.16384, time stamp: 0x5010ac2f
Exception code: 0xe0434352
Fault offset: 0x00014b32
Faulting process id: 0xe20
Faulting application start time: 0x01ce78485f1a4ba0
Faulting application path: c:\Program Files\ASTrace2012\ASTrace.exe
Faulting module path: C:\Windows\SYSTEM32\KERNELBASE.dll
Report Id: a6e9ead8-e43b-11e2-940d-00155d0ab306
Faulting package full name:
Faulting package-relative application ID:

--tags in the configuration file---------------------------------------------
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
     <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.ConnectionInfo" publicKeyToken="89845dcd8080cc91" />
        <bindingRedirect oldVersion="10.0.0.0" newVersion="11.0.0.0" />
        <publisherPolicy apply="no" />
     </dependentAssembly>
  </assemblyBinding>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
     <dependentAssembly>
        <assemblyIdentity name="Microsoft.SqlServer.ConnectionInfoExtended" publicKeyToken="89845dcd8080cc91" />
        <bindingRedirect oldVersion="10.0.0.0" newVersion="11.0.0.0" />
        <publisherPolicy apply="no" />
     </dependentAssembly>
  </assemblyBinding>
</runtime>
Developer
Jul 7, 2013 at 2:33 AM
I'm not clear from the error messages which DLLs are not found. If you would prefer to troubleshoot further and turn on FusionLog to see which DLLs aren't found, use these instructions:
http://www.hanselman.com/blog/BackToBasicsUsingFusionLogViewerToDebugObscureLoaderErrors.aspx

Another approach would be to use ASTrace2012.sln to compile the EXE. In the current release version, I used the exact same EXE as the AS2008 release and then added the assemblyBinding stuff into the app.config to have it use the 2012 DLLs. This approach is new to this ASTrace release, so it may be causing a problem.

I'm open to suggestions. Thanks for troubleshooting.
Jul 29, 2013 at 5:09 PM
Hi furmangg,

I'm still not able to make the binary working, this app is supposed to have system admins to download and use, it should be tested before release, right? we don't have skillsets on debugging, it seems simple though.

will you make a workable binary soon?
Developer
Jul 31, 2013 at 6:43 PM
I think I figured out the problem. Please right click on the ASTrace.exe file (and maybe also the ASTrace.pdb file) and then click Unblock.

.NET 4 has a new restriction about executing blocked files (i.e. files which have been downloaded from the internet.) The "Could not load file or assembly 'ASTrace.exe' or one of its dependencies. Operation is not supported. (Exception from HRESULT: 0x80131515)." was the clue.

Please let me know if that's it. If so, I will update the install instructions and republish.
Developer
Jul 31, 2013 at 7:18 PM
I went ahead and updated the ASTrace2012.zip file on the Downloads tab with updated instructions that mention unblocking. I think that's the problem, but please confirm.
Jul 31, 2013 at 9:52 PM
I didn't find the unblock button on Windows 2012 server. each time trying to start the ASTrace service, get Error 1053: The service did not respond to the start or control request in a timely fashion. and my application events show it's crashed:

Log Name: Application
Source: .NET Runtime
Date: 7/31/2013 2:47:50 PM
Event ID: 1026
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: Server01
Description:
Application: ASTrace.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.FileNotFoundException
Stack:
at ASTrace.Trace..ctor()
at ASTrace.Program.Main()

Log Name: Application
Source: Application Error
Date: 7/31/2013 2:47:50 PM
Event ID: 1000
Task Category: (100)
Level: Error
Keywords: Classic
User: N/A
Computer: Server01
Description:
Faulting application name: ASTrace.exe, version: 2.1.0.0, time stamp: 0x51f190db
Faulting module name: KERNELBASE.dll, version: 6.2.9200.16384, time stamp: 0x5010ac2f
Exception code: 0xe0434352
Fault offset: 0x00014b32
Faulting process id: 0xa7c
Faulting application start time: 0x01ce8e379a21e11e
Faulting application path: C:\Program Files\ASTrace2012\ASTrace.exe
Faulting module path: C:\Windows\SYSTEM32\KERNELBASE.dll
Report Id: d7dcbb18-fa2a-11e2-940f-00155d0ab306
Faulting package full name:
Faulting package-relative application ID: