Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Reclaiming free space on Log file. Expand / Collapse
Author
Message
Posted Tuesday, August 19, 2014 12:24 PM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Friday, November 21, 2014 9:06 AM
Points: 124, Visits: 451
Thank you SQLRNNR. sorry, I am trying to explain better way:
There is a log file 100 GB. New transaction occurs and it shows 125 GB log file backup on E:\ (got it from Log shipping primary backup at 1 pm).
According to Gila total log file would be 125+1 GB(99% free on 100 GB) total 126 GB.
Next If I take a transaction log backup, will transaction log backup make log file (.ldf) smaller or just makes VLF to 0 but size remains 126 GB?
Will there be again 99% free space on 125 GB log file (.ldf)?
at what point I reclaim disk space? just say my .ldf file is now 500 GB but 99% free, shouldn't I claim at least 400 GB space for different purpose because .ldf is only occupied 5 GB (1%)?
Post #1605107
Posted Tuesday, August 19, 2014 12:34 PM


SSCoach

SSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoachSSCoach

Group: General Forum Members
Last Login: Today @ 3:32 PM
Points: 17,963, Visits: 15,966
smtzac (8/19/2014)
Thank you SQLRNNR. sorry, I am trying to explain better way:
There is a log file 100 GB. New transaction occurs and it shows 125 GB log file backup on E:\ (got it from Log shipping primary backup at 1 pm).
According to Gila total log file would be 125+1 GB(99% free on 100 GB) total 126 GB.

I think you are confusing things.
Your log backup was 125GB. That would be the size of the transaction log that was in use. Just because the backup was 125GB, does not indicate that it was a single transaction. It very well could have been a 124GB transaction.


Next If I take a transaction log backup, will transaction log backup make log file (.ldf) smaller or just makes VLF to 0 but size remains 126 GB?
Will there be again 99% free space on 125 GB log file (.ldf)?

If you take another log backup, the size of that backup could be anything from 1k to 125GB. When a log backup occurs, it does not shrink your file. It backs up the used space, and truncates that space internally. This does not reduce your VLF to 0, each vlf that was backed up and cleared is marked ready to be used by a new transaction. Your free space will be anything between 100% free and 0% free.

at what point I reclaim disk space? just say my .ldf file is now 500 GB but 99% free, shouldn't I claim at least 400 GB space for different purpose because .ldf is only occupied 5 GB (1%)?

You don't reclaim the disk space via log backups. The log backup reclaims the space internally for use later on.

If the log grew to 125GB, it is likely because the log needs to be that size.

Like Gail has already said, Shrinking the log will likely just mean it will regrow later. Constant growing and shrinking of the log is not recommended and will lead to performance issues (think slower IO for starters).




Jason AKA CirqueDeSQLeil
I have given a name to my pain...
MCM SQL Server, MVP


SQL RNNR

Posting Performance Based Questions - Gail Shaw
Post #1605122
Posted Tuesday, August 19, 2014 6:46 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, September 25, 2014 4:07 AM
Points: 2, Visits: 109
If the Log file grows to 100GB means it does for specific reason, so in future also It tends to grow in same fashion. So, Unless there is Urgent Requirement for Space for Other Databases don't try to Shrink the Log file. I faced similar issues in the Past in my Environment.
Post #1605258
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse