Problem: How to know log
space utilized by each database.
This is a
DBCC Command makes it a cake walk when there is an issue that complains about
insufficient log backup scheduling or incorrect log file sizing.
We can
also use this command to clear out the wait stats and latch stats when ran on
context of a particular DB.
Example:
In this
article I am going to show you how we can retrieve log space of all databases.
Example 1:
--
sqlperf to view logspace utilized by eachdb in % and mega bytes.
DBCC sqlperf(logspace) with no_infomsgs
OUTPUT:
Example 2:
-- sys.dm_os_wait_stats:Returns
information about all the waits encountered by threads that executed
select * from
sys.dm_os_wait_stats
--to clear
the wait stats specify clear using DBCC SQL PERF.
DBCC SQLPERF ('sys.dm_os_wait_stats',
CLEAR);
GO
select * from
sys.dm_os_wait_stats
OUTPUT:
0 comments:
Post a Comment