Solved

Managing SQL log files, SQL Server 2014

Posted on 2016-11-14
6
106 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 29

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
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 
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

NFR key for Veeam Agent for Linux

Veeam is happy to provide a free NFR license for one year.  It allows for the non‑production use and valid for five workstations and two servers. Veeam Agent for Linux is a simple backup tool for your Linux installations, both on‑premises and in the public cloud.

Question has a verified solution.

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

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Microsoft Access is a place to store data within tables and represent this stored data using multiple database objects such as in form of macros, forms, reports, etc. After a MS Access database is created there is need to improve the performance and…
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

623 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