Veritabanına göre Transactions/sec değerini aşağıdaki T-SQL ile bulabilirsiniz:
if (object_id('tempdb.dbo.#tmpwait1') is not null )
begin
drop table #tmpwait1
end
select instance_name, cntr_value into #tmpwait1
from sys.dm_os_performance_counters
where object_name = 'SQLServer:Databases' and counter_name = 'Transactions/sec'
waitfor delay '00:00:01'
if (object_id('tempdb.dbo.#tmpwait2') is not null )
begin
drop table #tmpwait2
end
select instance_name, cntr_value into #tmpwait2
from sys.dm_os_performance_counters
where object_name = 'SQLServer:Databases' and counter_name = 'Transactions/sec'
select t1.instance_name DatabaseName, (t2.cntr_value-t1.cntr_value) as TPS
from #tmpwait1 t1 inner join #tmpwait2 t2 on t1.instance_name=t2.instance_name
order by 2 desc
Hiç yorum yok:
Yorum Gönder