Solved

Managing SQL log files, SQL Server 2014

Posted on 2016-11-14
6
56 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
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 21

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 18

Expert Comment

by:Pawan Kumar Khowal
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
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 68

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 11

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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

OfficeMate Freezes on login or does not load after login credentials are input.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
This tutorial will walk an individual through the process of configuring basic necessities in order to use the 2010 version of Data Protection Manager. These include storage, agents, and protection jobs. Launch Data Protection Manager from the deskt…
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …

744 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now