Quantcast
Viewing all articles
Browse latest Browse all 1849

Identify Used Space in Log File- Interview Question of the Week #090

Question: How to identify Used Space in Log File?

Answer: Use following command to display used log file size and total used space in the logfile.

DBCC SQLPERF('LOGSPACE')

After running above DBCC command it will give the following results.

Image may be NSFW.
Clik here to view.

You can see four different columns in the resultset.

The first column displays the name of the database. The second column contains the total size of the logfile in MB. The third column is actually our answer. It contains a total Log Space Used in the percentage. We can simple formula of (LogSize * Log Space Used) / 100 to find how much total space in used in MB. The fourth and final column is always zero and it has no meaning when we are running DBCC SQLPERF with parameter LOGSPACE.

If you are taking regular backup of the logfile, your file will not grow beyond certain value and it will also have free space. There should not be any need of shrinking the log file.

Here are few of the related blog posts:

Reference: Pinal Dave (http://blog.sqlauthority.com)

First appeared on Identify Used Space in Log File- Interview Question of the Week #090

Image may be NSFW.
Clik here to view.

Viewing all articles
Browse latest Browse all 1849

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>