Databases Reference
In-Depth Information
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
Relog
Provided with Windows, Relog is a command line tool that enables administrators to extract and
manipulate performance counter data from System Monitor logs. For example, Relog allows users to
resample from a performance log, changing characteristics such as the sample interval and output
format. Additionally, you may also use relog to insert an entire log file into a database. Relog simply
requires an ODBC DSN name, and it will load the performance data directly into a database for analysis
and reporting purposes. The following command resamples an existing log file with a sample time of
30 seconds and provides a list of the counters recorded:
Relog D: \ logs \ 11am.blg -cf ctr_list.txt -o D: \ Logs \ smallerint.csv -t 30 -f csv
Another helpful function of Relog is to combine log files. This can be useful if you're running continuous
performance monitoring, but a service restart or reboot interrupts monitoring, causing log files to be split
but covering consecutive timeframes. Relog allows these log files to be concatenated to produce a new
log file with the following command:
Relog logA.blg logB.blg logC.blg -o logALL.blg
Beware when running this: As you append more and more files to the end, the target log file can become
somewhat large (and thus harder to manage in itself). Once the logs have been combined, you can make
use of the
band
e switches to extract performance data relating to a specific timeframe.
Analyzing Log Data
Much of the discussion to this point has been concerned with the collection of data, how you can min-
imize the impact of monitoring, and acquire meaningful data. The ability to import System Monitor
performance data into SQL Profiler has been discussed, and this significantly reduces the time and effort
required to correlate specific user activity with server performance characteristics.
Search WWH ::




Custom Search