SQL BI

My Experience - Troubleshooting SQL BI Stack

SQL 2005 (SQL 2008) Analysis Services Server Side Tracing

SQL 2005 (SQL 2008) Analysis Services Server Side Tracing

Rate This
  • Comments 19

 

With Analysis Services 2005 (2008) you can collect traces without using gui this feature is known as Server Side Tracing.

In this article we’ll talk about how to achieve Server Side Tracing.

How to create a Server Side Trace

  • Open SQL Server profiler connect to Analysis Services and in an Event Selection define the SSAS Events.

       image

  • Next script the trace by going to "File – Export – Script Trace Definition – For Analysis Services 2005 (AS 2005 and 2008 in case of 2008)".

image

 

  • Open the Script file in Notepad and cut and copy the Events and Filter Elements to below mentioned script.

<!--Copy this Script file in Notepad and Replace Events and Filters Elements with the elements which you had generated from Trace Definition file—>

<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
  <Create xmlns="
http://schemas.microsoft.com/analysisservices/2003/engine">
    <ObjectDefinition>
      <Trace>
        <ID>DBA Performance Trace</ID>
        <Name>DBA Performance Trace</Name>
            <!--UPDATE YOUR OUTPUT PATH!!!!!!!-->
        <LogFileName>C:\OLAP_TRACE.trc</LogFileName>
        <LogFileAppend>1</LogFileAppend>
        <AutoRestart>0</AutoRestart>
            <!--Logfilesize is in MB-->
        <LogFileSize>5000</LogFileSize>
        <LogFileRollover>1</LogFileRollover>
            <!-- Uncomment and upade stoptime if you want to auto stop -->
            <!--StopTime>...</StopTime—>
      
<Events>
            <!--Add Events from the Trace Definition File—>
        </Events>
        <Filter>
            <!--Add If you have defined any filters then add it here—>
        </Filter>

      </Trace>
    </ObjectDefinition>
  </Create>
</Batch>


After Making Changes Script Will Look Something Like this.

<Batch xmlns="http://schemas.microsoft.com/analysisservices/2003/engine"
xmlns:soap="
http://schemas.xmlsoap.org/soap/envelope/">
  <Create xmlns="
http://schemas.microsoft.com/analysisservices/2003/engine">
    <ObjectDefinition>
      <Trace>
        <ID>DBA Performance Trace</ID>
        <Name>DBA Performance Trace</Name>
        <!--UPDATE YOUR OUTPUT PATH!!!!!!!-->
        <LogFileName>C:\OLAP.trc</LogFileName>
        <LogFileAppend>1</LogFileAppend>
        <AutoRestart>0</AutoRestart>
        <!--Logfilesize is in MB-->
        <LogFileSize>5000</LogFileSize>
        <LogFileRollover>1</LogFileRollover>
        <!-- Uncomment and upade stoptime if you want to auto stop -->
        <!--StopTime>...</StopTime-->
        <Events>
          <Event>
            <EventID>15</EventID>
            <Columns>
              <ColumnID>28</ColumnID>
              <ColumnID>32</ColumnID>
              <ColumnID>36</ColumnID>
             </Columns>
          </Event>
          <Event>
            <EventID>16</EventID>
            <Columns>
              <ColumnID>24</ColumnID>
              <ColumnID>32</ColumnID>
              <ColumnID>1</ColumnID>
             </Columns>
          </Event>
        </Events>
        <Filter>
          <NotLike>
            <ColumnID>37</ColumnID>
            <Value>SQL Server Profiler</Value>
          </NotLike>
        </Filter>
      </Trace>
    </ObjectDefinition>
  </Create>
</Batch>

Open Management Studio on Server or any Client box connect to Analysis Services then go to file  –> New XMLA Command –> Copy this Script and Execute it, this will initiate Trace on Server.

How to Find out whether Script is Running

<!--This script will give you a list off all running traces—>
<!—By Default you will get trace for Flight Recorder—>

<Discover xmlns="urn:schemas-microsoft-com:xml-analysis">
  <RequestType>DISCOVER_TRACES</RequestType>
  <Restrictions>
    <RestrictionList>
    </RestrictionList>
  </Restrictions>
  <Properties>
    <PropertyList>
    </PropertyList>
  </Properties>
</Discover>

How to Drop the Trace which you had created

<Delete xmlns="http://schemas.microsoft.com/analysisservices/2003/engine" xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/">                                  <Object>                                                                                                                 <TraceID>DBA Performance Trace</TraceID>                                                             </Object>                                                                                                                </Delete>

Note:

When you generate a trace definition using Profiler Trace it excludes LogFileName, LogSize etc, that is why I had suggested to use script which I had created.

Secondly, you need to define the stop time or you can drop the trace by giving above mentioned command (this will only stop the trace but will not physically drop the file).

This trace script file is amended from an example given in SSAS Processing Best Practices

Comments
  • Hello Chandan - sorry to hear that you were not able to use ASTrace Utility.

    For new release i had provided step by step of using it in Documentation.

    Here is the link - fee free to use it and contact me if you need any kind of clarifications.

    Go to this link - sqlsrvanalysissrvcs.codeplex.com

    You will find AS Trace2008 and AS Trace2012

    Click on it and it will allow you to download updated binaries with step by step configuration details.

    feel free to ping me if you need any help.

    Karan Gulati

  • Thank you for sharing. You create the trace for the whole Server, right ?

    A question, if there are many databases in the Analysis Server, how can I create the trace for the database chosen?

  • yes you can do that, while create a trace template like shown in a post, there is a way of selecting a specific database - go to column filter (option shown in first image) and then add filters as per your requirement.

  • I got that, thank you very much!

Page 2 of 2 (19 items) 12
Leave a Comment
  • Please add 8 and 7 and type the answer here:
  • Post