Solved

Managing SQL log files, SQL Server 2014

Posted on 2016-11-14
6
97 Views
Last Modified: 2016-11-15
Hello, I have a SQL server that is running two databases. The log files for the two databases are quite large. Both are between 15-20GB. The recovery mode is full. They are eating up a large portion of my disk space. The autogrowth/maxsize appears to have been set incorrectly by the person I took over for (it's set to 2TB). I believe this was a mistake.

Can I change the autogrowth/maxsize while it is in production?
Can I set it smaller than what the initial size is?
I keep reading about the best practices on what to actually set the max size to and I'm confused.

Disk Usage report on one first database:
Total Space: 30.51 GB
Data Files Space Reserved: 12,944.38 MB
Transaction Log Space Reserved 18,293.19 MB

Disk Usage report on the second database:
Total Space: 30.31 GB
Data Files Space Reserved: 10,682.81 MB
Transaction Log Space Reserved: 20.358.06 MB

I need to free up space if this is set all wrong, I want to make sure this follows best practices at the same time, I appreciate everyone's time!

My experience with managing SQL is quite low at this point, so I apologize in advance if this question is put together poorly, or lacking necessary info, I'll add anything missing on request.
0
Comment
Question by:Kyle Power
[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
6 Comments
 
LVL 34

Expert Comment

by:Brian Crowe
ID: 41887055
First question to answer...How often are you performing a transaction log backup?
1
 
LVL 23

Expert Comment

by:yo_bee
ID: 41887144
Do you need Recovery Mode Full for your databases?  If not you can save space.
the only need to have Recovery Mode Full is if you need to restore to a very granular level.

If you set it to Simple Mode and enable Auto Shrink to True you can truncate all the space in your logs to about 1 MB.
1
 
LVL 28

Expert Comment

by:Pawan Kumar
ID: 41887300
Excellent question by Brain.

Actually user sets recovery model to full & forgets to do transaction log backups. You have to switch to the simple recovery model or start backing up your logs. :)
0
Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

 
LVL 70

Accepted Solution

by:
Qlemo earned 250 total points
ID: 41887522
Background info: in Full Recovery Mode the transaction log has to keep all changes between two transaction log backups. If there is no such backup, all changes are contained. Of course the log file gets very big that way.
In Simple Recovery Mode only active (open) transactions are kept, until all changes are reliably written back into the data file(s).
As said, your choices are to either switch the recovery mode or perform transaction log backups.
If you want to keep Full Recovery Mode, you'll nevertheless need to switch to Simple, truncate the log, switch back to Full Recovery, perform a full backup, and then set up the transaction log backup.
0
 
LVL 12

Assisted Solution

by:Máté Farkas
Máté Farkas earned 250 total points
ID: 41887724
You don't need FULL Recovery model if you don't use one of the following technologies:
 - Transaction Log backups
 - Mirroring or AlwaysOn HA solution
 - Logshipping
 - Transactional replication
 - Change data capture

You can switch between recovery models, autogrowth setting or shrink log also in production. Server will not stop or restart.
0
 

Author Closing Comment

by:Kyle Power
ID: 41888863
Thanks guys! Brian, sorry I was slow to reply. I have set the recovery to simple and shrunk the log files, set back to full and set the limit to something much more reasonable. Logs will be truncated by Veeam.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
T-SQL: need to reset a declared variable 4 31
domain controller shut down question 6 64
sql server query 9 26
PCI report results 1 10
Background Information Recently I have fixed file server permission issues for one of my client. The client has 1800 users and one Windows Server 2008 R2 domain joined file server with 12 TB of data, 250+ shared folders and the folder structure i…
In the first part of this tutorial we will cover the prerequisites for installing SQL Server vNext on Linux.
Via a live example, show how to backup a database, simulate a failure backup the tail of the database transaction log and perform the restore.
Via a live example, show how to shrink a transaction log file down to a reasonable size.

734 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