Solved

Maintaining SQL Server logs size automatically to reserve disk space

Posted on 2016-10-02
4
67 Views
Last Modified: 2016-10-02
Hi All,

I've got SQL Server 2012 Std database that is always running out of disk space.
The culprit is that the Web proxy reporting software which is growing larger that 275 GB while the disk space in the Physical server D: drive ia only 279 GB maximum.

So I wonder how can I automate the SQL Server to truncate the SQL Database .LDF file to be always lower than 100 GB to maintain disk space size which is not impacting the Web reporting software.

Thanks,
0
Comment
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 13

Expert Comment

by:Nakul Vachhrajani
ID: 41825402
You can restrict the max size of the log file, but, first things first - what is the recovery model of the database? If it is FULL recovery, are you taking regular log backups?

If you are not taking log backups and the recovery model is FULL, that would explain an ever growing log file. Otherwise, the log file should get "recycled" as soon as you take the log backup.
0
 
LVL 8

Author Comment

by:Senior IT System Engineer
ID: 41825619
Ok Nakul,
The backup mode was full, so how do I automate make the truncate only the log file or not needed after I changed it to simple ?
0
 
LVL 13

Accepted Solution

by:
Nakul Vachhrajani earned 500 total points
ID: 41825627
Simple recovery makes sense if you do not need point in time recovery of the reporting database. If you need point-in-time recovery, you will need to use FULL recovery and take regular log backups.

If the database is in simple recovery mode, you generally do not need to implement any automatic truncation. The checkpoint process will automatically take care of marking space within the log as "available" once data has been flushed to the data files.

So, I would suggest to keep monitoring your log file - long and bulky transactions (typically indicative of code that can still be tuned) can still result into huge log files. But for most cases, you should be all set if the recovery model is simple.
0
 
LVL 8

Author Closing Comment

by:Senior IT System Engineer
ID: 41825628
Thanks Nakul
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Ever needed a SQL 2008 Database replicated/mirrored/log shipped on another server but you can't take the downtime inflicted by initial snapshot or disconnect while T-logs are restored or mirror applied? You can use SQL Server Initialize from Backup…
In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question