T-SQL – Monitor All Database Logs
One of the critical DBA’s job is to monitor the logs of the databases. The logs are almost as important as the data itself. They allow you to recover and/or roll back to known, stable states.
You can look at the file size through Windows Explorer.
You can see some log info through the SQL Management Studio > Database > right click Properties > Files
You can see the log size and more important the percentage used with TSQL. Using this script you can monitor all the database logs.
DBCC SQLPERF(LOGSPACE) WITH no_infomsgs;
To expand or change the logs parameters in SQL Server Management Studio:
- Select the database, right-click > Properties
- Select Files
- Specify how the file should grow by clicking (…) in the Autogrowth column.
- Select the Enable Autogrowth check box.
- Specify the growth by fixed increments in Mb. or
- Specify the growth by fixed increments in %.
- Specify the maximum file size limit