Readme for Activity Viewer Sample

The Activity Viewer sample is a tool that displays users, connections, and processes for an instance of Microsoft SQL Server 2005 Analysis Services (SSAS). You can use this tool to retrieve a list of these items and, if you want to, to stop a process.

Default location: <system_drive>\Program Files\Microsoft SQL Server\90\Samples\Analysis Services\Administrator\ActivityViewer

Scenario

Functionality similar to SQL Server stored procedure sp_who and kill command in Transact-SQL.

Languages

C#

Features

The Activity Viewer sample uses the following SQL Server 2005 features:

Application Area Features

Overall

AMO, ADOMD .NET

Prerequisites

Before you run this sample, make sure that the following software is installed:

Note   SQL Server 2005 Business Intelligence Development Studio is not supported on computers that run the Itanium-based platform; the 64-bit development environment is supported on x64-based platforms. SQL Server 2005 samples can be modified and run on computers that run either x86 or x64-based platforms when the databases used by the samples are deployed on an Itanium-based platform.

Building the Sample

If you have not already created a strong name key file, generate the key file using the following instructions.

To generate a strong name key file

  1. Open a Microsoft Visual Studio 2005 command prompt. Click Start, point to All Programs, point to Microsoft .NET Framework SDK 2.0, and then click SDK Command Prompt.

    -- or --

    Open a Microsoft .NET Framework command prompt. Click Start, point to All Programs, point to Microsoft .NET Framework SDK 2.0, and then click SDK Command Prompt.

  2. Use the change directory command (CD) to change the current directory of the command prompt window to the folder where the samples are installed.

    Note

    To determine the folder where samples are located, click the Start button, point to All Programs, point to Microsoft SQL Server, point to Documentation and Tutorials, and then click Samples Directory. If the default installation location was used, the samples are located in <system_drive>:\Program Files\Microsoft SQL Server\100\Samples.

  3. At the command prompt, run the following command to generate the key file:

    sn -k SampleKey.snk

    Important

    For more information about the strong-name key pair, see "Security Briefs: Strong Names and Security in the .NET Framework" in the .NET Development Center on MSDN.

After you have a strong name key file, you can build the sample using the following procedure.

To build the sample

  1. Compile the sample using one of the following methods:

    • In Microsoft Visual Studio 2005, compile the sample by using the provided Visual Studio solution
      — or —
    • Compile the sample by using MSBuild , which is included in the Microsoft .NET Framework SDK 2.0. At the command prompt, run commands similar to the following command:
      msbuild /nologo /verbosity:quiet /property:Configuration=Debug CS\ActivityViewer\ActivityViewer.csproj
  2. Make sure that the AdventureWorks AS database is installed. Alternatively, create the database where you want to install the samples.

Running the Sample

To run the sample, follow these steps.

To run the sample

  1. Run either bin\Release\ActivityViewer.exe or bin\Debug\ActivityViewer.exe.

    Running either of these executables will show the Analysis Services groups and servers that are registered in SQL Server Management Studio.

  2. To connect or disconnect, right-click a server.

  3. To see details, click the Connection/Session/Transaction/Locks node. You can also right-click the node and select Refresh.

  4. Right-click a connection to see its sessions. Right-click Sessions to see its transactions. Right-click a transaction to see its locks.

  5. To cancel a connection or session, right-click the connection or session, and then select Cancel. Canceled connections and session activities are logged to a tab-delimited text file. By default, the file is located in the same directory as the executable and the file is named Activity.log. You can specify the file name and path in ActivityViewer.exe.config file. Also, you can change the value of TraceActivity property; possible values are as follows: 0= off/no logging, 1=Errors, 2=Warnings, 3=Informational, 4=Verbose. The default value is Verbose = 4.

See Also

Tasks

SQL Server Analysis Services Samples

Help and Information

Getting SQL Server 2005 Assistance

Change History

Release History

17 July 2006

New content:
  • Added note on availability for Itanium-based platform.

5 December 2005

Changed content:
  • Changed instructions for generating a key file, that include the name and location of the key file.