Readme for Activity Viewer Sample
Updated: 17 July 2006
The Activity Viewer sample is a tool that displays users, connections, and processes for an instance of Microsoft . 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
Functionality similar to SQL Server stored procedure sp_who and kill command in Transact-SQL.
The Activity Viewer sample uses the following SQL Server 2005 features:
| Application Area || Features |
| Overall|| AMO, ADOMD .NET |
Before you run this sample, make sure that the following software is installed:
- The AdventureWorks AS database that is included with SQL Server 2005. You might have to install the samples. For more information, see Running Setup to Install AdventureWorks Sample Databases and Samples in SQL Server 2005 Books Online.
- An updated version of AdventureWorks database is also available for download on the SQL Server Developer Center Web page.
- An updated version of the SQL Server 2005 Database Engine samples is also available for download on the SQL Server Developer Center Web page.
- .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. The .NET Framework SDK is available free of charge. For more information, see Installing the .NET Framework SDK in SQL Server 2005 Books Online. 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
- 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.
- 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 2005, 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\90\Samples.*
- 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
- 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
- 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
- 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.
- To connect or disconnect, right-click a server.
- To see details, click the Connection/Session/Transaction/Locks node. You can also right-click the node and select Refresh.
- Right-click a connection to see its sessions. Right-click Sessions to see its transactions. Right-click a transaction to see its locks.
- 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.
| 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. |
© 2007 Microsoft Corporation. All rights reserved.