Go Premium for a chance to win a PS4. Enter to Win

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 121
  • Last Modified:

Managing SQL log files, SQL Server 2014

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
Kyle Power
Asked:
Kyle Power
2 Solutions
 
Brian CroweCommented:
First question to answer...How often are you performing a transaction log backup?
1
 
yo_beeDirector of ITCommented:
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
 
Pawan KumarDatabase ExpertCommented:
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
Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

 
QlemoC++ DeveloperCommented:
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
 
Máté FarkasDatabase Developer and AdministratorCommented:
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
 
Kyle PowerAuthor Commented:
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

Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now