Search

Thursday, July 5, 2012

Finding Databases which had Transaction Log Growth

The following T-SQL script will give the list of the databases and how many times the log file grew by using the auto-grow value. This information is available since the last restart of the SQL Instance and will be reset again when the Instance is restarted. This list will not count if you grow the log file manually.



SELECT INSTANCE_NAME,cntr_value FROM MASTER.dbo.sysperfinfo
WHERE COUNTER_NAME = 'Log Growths'
AND INSTANCE_NAME NOT IN ('_Total','mssqlsystemresource')
AND CNTR_VALUE <> 0

No comments:

Post a Comment