2.15. Built-in Log Management Tools

There are two tools of choice provided within Windows to assist with log automation, log handling, and interpreting log data. This section provides an overview and in some cases samples of these tools and utilities.

2.15.1. LogMan

You can use LogMan to schedule the start and stop of logging. This is a useful alternative to using the Windows AT scheduler or the Performance Monitor features to achieve similar results. The benefits of LogMan over configuring scheduling within individual Performance Monitor instances is that LogMan enables you to configure a data collection and to copy that collection to multiple computers from a single location. A data collection is essentially a System Monitor log definition.

Once you've defined a data collection, you're able to copy this to all target servers and then centrally control the start and stop of logging. The following command can be used to create a data collection that will run for two hours from 11 p.m. (23:00:00) and sample % Processor Time, Average Disk Queue Length, and Available Bytes every 30 seconds:

Logman create counter nightly_log -b 7/27/2007 23:00:00 -e 7/28/2008 01:00:00
-r -o "D:\logs\nightlylog" -c "\Processor(_Total)\% Processor Time"
"Physical Disk\Average Disk Queue Length" "\Memory\Available bytes" -si 00:30

You may also use the following command to query a data collection or currently running log:

Logman query
Logman query nightly_log

2.15.2. Relog

Provided with Windows, Relog ...

Get Professional SQL Server® 2005 Performance Tuning now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.