February 26, 2015 at 4:40 pm
Hi,
I am looking for the script to find the CPU usage for each database like this
Test1DB76.00%
Test2DB12.00%
Test3DB1.21%
Test4DB20.08%
February 26, 2015 at 6:45 pm
ramana3327 (2/26/2015)
Hi,I am looking for the script to find the CPU usage for each database like this
Test1DB76.00%
Test2DB12.00%
Test3DB1.21%
Test4DB20.08%
What are you trying to accomplish? If you want to tune up CPU, you should looked at which ones are the TOP CPU hungry queries, not what database seems to use more CPU.
February 27, 2015 at 6:06 am
The only way I can think to do this would be to capture the query metrics for all the databases and then group the data. There's nothing that splits CPU use by database.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
February 27, 2015 at 8:35 am
Something similar and close to question was discussed in past .
http://www.sqlservercentral.com/Forums/Topic1316138-146-1.aspx
February 27, 2015 at 9:44 am
select d.name,
sum(r.cpu_time)
from sys.databases d join sys.dm_exec_requests r
on d.database_id = r.database_id
group by d.name
order by sum(r.cpu_time) desc
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply