Solved

Maintaining SQL Server logs size automatically to reserve disk space

Posted on 2016-10-02
4
65 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
  • 2
  • 2
4 Comments
 
LVL 12

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 7

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 12

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 7

Author Closing Comment

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

Featured Post

Microsoft Certification Exam 74-409

VeeamĀ® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Load balancing is the method of dividing the total amount of work performed by one computer between two or more computers. Its aim is to get more work done in the same amount of time, ensuring that all the users get served faster.
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

777 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