sql | SQL‎ > ‎sql | Downloads‎ > ‎sql | Notes‎ > ‎

note.sqlsrv | logman

logman.exe create counter Perf-Counter-Log -f bincirc -v mmddhhmm -max 250 -c "\LogicalDisk(*)\*" "\Memory\*" "\Network Interface(*)\*" "\Paging File(*)\*" "\PhysicalDisk(*)\*" "\Process(*)\*" "\Redirector\*" "\Server\*" "\System\*"  -si 00:05:00
Action Description

logman create

Create a counter, trace, configuration data collector, or API.

logman query

Query data collector properties.

logman start | stop

Start or stop data collection.

logman delete

Delete an existing data collector.

logman update

Update the properties of an existing data collector.

logman import | export

Import a data collector set from an XML file or export a data collector set to an XML file.

\\<serverName>\SQLServer:Exec Statistics(*)\*
\\<serverName>\SQLServer:General Statistics\*
\\<serverName>\SQLServer:Memory Manager\*
\\<serverName>\SQLServer:SQL Statistics\*
\\<serverName>\SQLServer:Wait Statistics(*)\*
"\Memory\Available MBytes"
"\Memory\Free System Page Table Entries"
"\Memory\Pages Input/sec"
"\MSSQL$DEV:Access Methods\Full Scans/sec"
"\MSSQL$DEV:Access Methods\Page Splits/sec"
"\MSSQL$DEV:Access Methods\Workfiles Created/sec"
"\MSSQL$DEV:Access Methods\Worktables Created/sec"
"\MSSQL$DEV:Buffer Manager\Buffer cache hit ratio"
"\MSSQL$DEV:Buffer Manager\Checkpoint pages/sec"
"\MSSQL$DEV:Buffer Manager\Free pages"
"\MSSQL$DEV:Buffer Manager\Lazy writes/sec"
"\MSSQL$DEV:Buffer Manager\Page life expectancy"
"\MSSQL$DEV:Buffer Manager\Page reads/sec"
"\MSSQL$DEV:Buffer Manager\Page writes/sec"
"\MSSQL$DEV:Buffer Manager\Stolen pages"
"\MSSQL$DEV:General Statistics\Logins/sec"
"\MSSQL$DEV:General Statistics\Logouts/sec"
"\MSSQL$DEV:General Statistics\User Connections"
"\MSSQL$DEV:Latches\Average Latch Wait Time (ms)"
"\MSSQL$DEV:Locks(_Total)\Average Wait Time (ms)"
"\MSSQL$DEV:Locks(_Total)\Lock Requests/sec"
"\MSSQL$DEV:Locks(_Total)\Number of Deadlocks/sec"
"\MSSQL$DEV:Memory Manager\Target Server Memory (KB)"
"\MSSQL$DEV:Memory Manager\Total Server Memory (KB)"
"\MSSQL$DEV:SQL Statistics\Batch Requests/sec"
"\MSSQL$DEV:SQL Statistics\SQL Compilations/sec"
"\MSSQL$DEV:SQL Statistics\SQL Re-Compilations/sec"
"\Paging File(_Total)\% Usage"
"\Paging File(_Total)\% Usage Peak"
"\PhysicalDisk(_Total)\Avg. Disk Read Queue Length"
"\PhysicalDisk(_Total)\Avg. Disk sec/Read"
"\PhysicalDisk(_Total)\Avg. Disk sec/Transfer"
"\PhysicalDisk(_Total)\Avg. Disk sec/Write"
"\PhysicalDisk(_Total)\Avg. Disk Write Queue Length"
"\Process(sqlservr)\% Privileged Time"
"\Process(sqlservr)\% Processor Time"
"\Processor(_Total)\% Privileged Time"
"\Processor(_Total)\% Processor Time"
"\System\Context Switches/sec"
"\System\Processor Queue Length"
logman create counter SQL2005Perf -f bin  -b 01/01/2009 00:00:05  -E 01/01/2009 23:59:00  -si 05 -v mmddhhmm -o "E:\perflogs\SQL2005Perf" -cf "E:\perflogs SQL2005BaselineCounters.config" -u domain\username *
schtasks /create /tn "Stop Copy And Start SQL2005Perf Perfmon Counter Log" /tr E:\perflogs\StopCopyStart.bat /sc daily /st 23:59:58 /ed 01/01/2099 /ru system
  • schtasks /create - create a new scheduled task
  • /tn "Stop Copy And Start SQL2005Perf Perfmon Counter Log" - scheduled task name
  • /tr E:\perflogs\StopCopyStart.bat - run this batch file
  • /sc daily /st 23:59:59 - schedule time
  • /ed 01/01/2099 - end date
  • /ru system - user account