How to monitor log file growth size

Source: Internet
Author: User

Monitoring log file size is a very important task, and SQL Server has made it easy for us to do so. One way to find out about the log information is in catalog view sys.database_files. This view returns information about the log file, including the file, name, location, status, size, growth, and so on. The following query statement will look only at the log file and display some very useful information.

SELECTName as [File Name], Physical_name as [Physical Name], size/128.0  as [Total Size in MB], size/128.0 - CAST(Fileproperty(Name,'spaceused') as int)/128.0  as [Available Space in MB],         [Growth],[file_id]         fromsys.database_filesWHEREType_desc= 'LOG'

Results:

You can also use DBCC to view, which will show log file size, usage, and so on.

DBCC SQLPERF ('logspace')

Results:

How to monitor log file growth size

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.