Readme for ASTrace Utility Sample

The ASTrace utility provides you with ability to capture an Analysis Services trace and log it into a SQL Server table. The table can be queried later or read using SQL Server Profiler. The ASTrace utility runs as a Windows service that connects to Analysis Services, then creates a trace, and logs trace events into a SQL Server table using the SQL Server Profiler format. The ASTrace utility creates the trace using a standard trace template that you can author using SQL Server Profiler.


Analysis Services does not have a built-in tool to extract traces and save them to a file or table. This ASTrace utility sample demonstrates how to implement that trace functionality.




Before running this sample, make sure the following software is installed:
  • Microsoft SQL Server 2005, including the following components:
  • Database Engine
  • Analysis Services
  • SQL Server Management Studio
  • Business Intelligence Development Studio
  • Database Engine Samples
  • Microsoft.NET Framework SDK 2.0 or Visual Studio 2005

Building the Sample

Option 1: To build the sample by using Visual Studio Locate the folder where the solution file ASTrace.sln is stored.Move the signature file ASTrace.snk to the solution folder.Open Visual Studio.On the Recent Projects tab, for Open, click Project.Open the folder where you saved the solution file ASTrace.sln, select the file, and then click Open.Press F6 to build the project. Option 2: To build the sample by using msbuild.exe from .Net Framework SDK Locate the folder where the solution file ASTrace.sln is stored.Move the signature file ASTracer.snk to the solution folder.Open a Command Prompt window and change directory to the location where the solution file is saved. Configure the environment according to the specifications in How to: Compile at the Command Prompt. Type msbuild.exe ASTrace.sln, then press Enter.

Installing the Sample

The following procedures describe how to install the ASTrace utility as a service.
Step 1: To copy executable files Copy following files into the folder where you intend to have the service running on your computer: ASTrace.exe ASTrace.exe.config Standard.tdf Step 2: To register the service Locate InstallUtil.exe in your installed version of the Microsoft .NET Framework SDK 2.0.Open a Command Prompt window.Change the current directory to the directory where you copied the executables files in previous step.Add the folder that contains InstallUtil.exe to the path.Run the following command to install the service: InstallUtil.exe ASTrace.exeIn Administrative Tools, open Computer Management, expand Services and Applications, and then select Services.Search for ASTrace Service in the right pane and double-click it. Verify in the General tab that the Path to executable shows the correct path to where you copied the files. The service is now registered and using your files.Note: Do not start the service until is configured in the next step. Step 3: To configure the service Open the ASTrace.exe.config file in Notepad or any other text editor that does not include control characters.Add content to the following fields according to their definition:

Running the Sample

The following procedures show how to start the service and configure security.
Step 1: To start the service Open Windows Service Control Manager, navigate to the ASTrace utility and start the service. Step 2: To configure security Make sure you change the ASTrace service account to an appropriate local or domain user account. This will minimize the surface attack area. To run the ASTrace service application, you must make sure that the service account that runs the service has following rights:

Removing the Sample

Use the following procedure to uninstall the service.
Step 1: To uninstall the ASTrace service Open a Command Prompt window and run the following command:InstallUtil.exe ASTrace.exe © 2007 Microsoft Corporation. All rights reserved.

Last edited Nov 6, 2008 at 11:13 PM by bonniefe, version 12


AndrewWiles Aug 21, 2008 at 1:03 PM 
The text in this article appears to have become badly formatted and some content is missing. Specifically the configuration fields are not described and the service rights are missing.