Hello,
I was wondering if there is a way to find out in T-SQL how busy CPU is. I
would like to get the same information as shown in CPU usage graph in Task
Manager.
Thanks,
IgorThere are other processes other than SQL Server that consume CPU resources.
Perhaps you can get this information using WMI.
"Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
news:elq%23aIoKFHA.3960@.TK2MSFTNGP09.phx.gbl...
> Hello,
> I was wondering if there is a way to find out in T-SQL how busy CPU is. I
> would like to get the same information as shown in CPU usage graph in Task
> Manager.
> Thanks,
> Igor
>|||I was hoping to obtain this information using T-SQL.
<WKidd> wrote in message news:%23ImbyToKFHA.1284@.TK2MSFTNGP14.phx.gbl...
> There are other processes other than SQL Server that consume CPU
> resources. Perhaps you can get this information using WMI.
> "Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
> news:elq%23aIoKFHA.3960@.TK2MSFTNGP09.phx.gbl...
>|||Igor Marchenko wrote:
> Hello,
> I was wondering if there is a way to find out in T-SQL how busy CPU
> is. I would like to get the same information as shown in CPU usage
> graph in Task Manager.
> Thanks,
> Igor
Not for the entire server. Only for SQL Server.
David Gugick
Imceda Software
www.imceda.com|||Could you please tell me how to do it for SQL server? I would like to know
how much of CPU percent wise is used by SQL server. Similar to what is shown
in process tab of Task bar.
Thanks,
Igor
"David Gugick" <davidg-nospam@.imceda.com> wrote in message
news:OJfqq4pKFHA.3552@.TK2MSFTNGP12.phx.gbl...
> Igor Marchenko wrote:
> Not for the entire server. Only for SQL Server.
> --
> David Gugick
> Imceda Software
> www.imceda.com|||You can use perfmon to see how much cpu SQL server is using, and it auto
refreshes so you watch and record performance.
Under "Process" performance object, select "% Processor Time", and in the
"Select instance from a list" section, select "sqlservr".
Obviously this is not a t-sql solution, but probably more intuitive,
especially if you want to log the results to review later.
Simon Worth
"Igor Marchenko" <igormarchenko@.hotmail.com> wrote in message
news:uvuFOvxKFHA.440@.TK2MSFTNGP10.phx.gbl...
> Could you please tell me how to do it for SQL server? I would like to know
> how much of CPU percent wise is used by SQL server. Similar to what is
shown
> in process tab of Task bar.
> Thanks,
> Igor
> "David Gugick" <davidg-nospam@.imceda.com> wrote in message
> news:OJfqq4pKFHA.3552@.TK2MSFTNGP12.phx.gbl...
>|||Igor Marchenko wrote:
> Could you please tell me how to do it for SQL server? I would like to
> know how much of CPU percent wise is used by SQL server. Similar to
> what is shown in process tab of Task bar.
> Thanks,
> Igor
From T-SQL, you can use the @.@.CPU_BUSY global variable along with
@.@.TIMETICKS. You'll have to search Google for the required calculation
as you'll have to compare the toal cpu used over an interval as compared
to the total time.
David Gugick
Imceda Software
www.imceda.com
No comments:
Post a Comment