SQL Server Monitoring Metrics
SQL Server Monitoring Metrics
To check the memory on your server we can use the dynamic management view
dm_os_sys_memory.
2. Are there any SQL Server statements in the cache that could use tuning?
The following query will identify any poor performing SQL statements. You can alter the
"order by" clause depending on what you are most concerned with (IO vs. CPU vs. Elapsed
Time).
This query on its own does not provide too much information other than show you if there
is some blocking in the system. However, once you get a baseline for your applications
through running this query, you'll be able to see if you have a higher than normal number of
connections. This can be an early sign that there may be a problem.
You can use the extended stored procedure xp_fixeddrives to get a look at the space left on
our drives.
exec master.dbo.xp_fixeddrives
You can use the query to get a look at the maximum size of a database in MB.
SELECT distinct
name,
size,
size * 8/1024 'Size (MB)',
max_size
FROM sys.master_files;
In order to check the SQL Server Error Log we are going to use the undocumented extended
stored procedure, xp_readerrorlog. This query will look at the current log and go back a
maximum of 2 days looking for any errors during that time frame.