The perfmon command allows you to manage counters, add delete adjustments, and more.
Example 1: Logman: Manage and schedule performance counters and event trace logs on both local and remote systems.
' logman query '
Example 2: Stop performance counter
' logman Stop Performance '
Example 3: Delete the performance counter
' logman Delete Performance '
Example 4:bcp exported to a text file
"/craw" parameter to disable automatic conversion of character codes
"-T" trust link, otherwise you need to specify-u,-P
"-C" uses the char type as the storage type, without a prefix and "\ t" as the field delimiter, with "\ n" as the line separator
' BCP TempDB.dbo.Temp_PfConfigure out "d:\PerformanceConfigure.txt"-t-c-craw '
Example 5: Create a counter based on a file
"-si" Specifies the collection interval, default 15 seconds
"-CF" creates the path to the counter name
The output mode of the "-F" counter result, specified here: SQL
The output location of the "-o" counter result, specifying the output ODBC connection performance and the log name performance
"-V" adds version control information to the end of the output file and path name
' logman Create counter performance-si 00:00:15-cf "D:\PerformanceConfigure.txt"-F Sql-o performance! Performance-v mmddhhmm'
Example 6: Starting the performance counter
' logman Start Performance '
PerfMon.exe managing counters through commands