dataplat / dbatools

🚀 SQL Server automation and instance migrations have never been safer, faster or freer
https://dbatools.io
MIT License
2.39k stars 787 forks source link

Is there a dbatools command that helps you translate an offending thread in the OS to a spid? #9300

Closed NagromCurse closed 2 months ago

NagromCurse commented 3 months ago

Summarize Command's Functionality

If you want to translate between an SQL Server thread (kpid) (for example, one that is swamping the CPU) and a spid, the only way that I know of is using Performance Monitor. This is a slow and manual process. Also, the situation you're investigating might be disappear while you're going through these manual steps.

It would be good if there was a command that could do this instantly. Or is there already one?

Is there a command that is similiar or close to what you are looking for?

No

Technical Details

This article describes the manual steps: https://www.mssqltips.com/sqlservertip/2454/how-to-find-out-how-much-cpu-a-sql-server-process-is-really-using/

NagromCurse commented 2 months ago

Found it: Get-DbaCpuUsage