Es wird eine Herausforderung sein, eine einheitliche Politik für ein so vielfältiges Anwesen anzuwenden. Meine erste Anlaufstelle wäre es, die größten Verbraucher von Schlüsselressourcen (CPU, Speicher, E / A) auf jeder Instanz zu verstehen, um die problematischen Datenbanken von den anderen zu isolieren. Glenn Berrys Healthcheck DMVs wären ein guter Ausgangspunkt.
Wer verwendet den größten Teil des Speichers (Pufferpools) auf jeder Instanz?
SELECT DB_NAME(database_id) AS [Database Name],
COUNT(*) * 8/1024.0 AS [Cached Size (MB)]
FROM sys.dm_os_buffer_descriptors
WHERE database_id > 4 -- system databases
AND database_id <> 32767 -- ResourceDB
GROUP BY DB_NAME(database_id)
ORDER BY [Cached Size (MB)] DESC OPTION (RECOMPILE);
Wie lange bleiben Seiten im Pufferpool?
SELECT cntr_value AS [Page Life Expectancy]
FROM sys.dm_os_performance_counters
WHERE [object_name] = N'SQLServer:Buffer Manager'
AND counter_name = N'Page life expectancy' OPTION (RECOMPILE);
Wer generiert die meisten E / A?
SELECT DB_NAME(DB_ID()) AS [Database Name],[file_id], num_of_reads, num_of_writes,
io_stall_read_ms, io_stall_write_ms,
CAST(100. * io_stall_read_ms/(io_stall_read_ms + io_stall_write_ms) AS DECIMAL(10,1)) AS [IO Stall Reads Pct],
CAST(100. * io_stall_write_ms/(io_stall_write_ms + io_stall_read_ms) AS DECIMAL(10,1)) AS [IO Stall Writes Pct],
(num_of_reads + num_of_writes) AS [Writes + Reads], num_of_bytes_read, num_of_bytes_written,
CAST(100. * num_of_reads/(num_of_reads + num_of_writes) AS DECIMAL(10,1)) AS [# Reads Pct],
CAST(100. * num_of_writes/(num_of_reads + num_of_writes) AS DECIMAL(10,1)) AS [# Write Pct],
CAST(100. * num_of_bytes_read/(num_of_bytes_read + num_of_bytes_written) AS DECIMAL(10,1)) AS [Read Bytes Pct],
CAST(100. * num_of_bytes_written/(num_of_bytes_read + num_of_bytes_written) AS DECIMAL(10,1)) AS [Written Bytes Pct]
FROM sys.dm_io_virtual_file_stats(DB_ID(), NULL) OPTION (RECOMPILE);
Welche Datenbanken verbrauchen am meisten CPU und welche Prozeduren?
SELECT
DB_NAME(qt.dbid) AS DatabaseName
, SUM(qs.total_worker_time) AS [TotalWorkerTime]
FROM
sys.dm_exec_query_stats AS qs
CROSS APPLY
sys.dm_exec_sql_text(qs.[sql_handle]) AS qt
WHERE
DB_NAME(qt.dbid) IS NOT NULL
GROUP BY
qt.dbid
ORDER BY
SUM(qs.total_worker_time) DESC
OPTION
(RECOMPILE) ;
SELECT TOP (1000)
DB_NAME(qt.dbid) AS DatabaseName
, qt.[text] AS [SP Name]
, qs.total_worker_time AS [TotalWorkerTime]
FROM
sys.dm_exec_query_stats AS qs
CROSS APPLY
sys.dm_exec_sql_text(qs.[sql_handle]) AS qt
WHERE
DB_NAME(qt.dbid) IS NOT NULL
ORDER BY
qs.total_worker_time DESC
OPTION
(RECOMPILE) ;