Reduce the Database log file size - Epicor server 10.2.200.27

In the SQL server size of the two database log files are more than 100 GB and we are running out of free space in the drive. Can someone please advise how we can reduce the database log file size to create some free space in the drive?

It sounds like you have your database set to Full recovery option, but do not have any SQL log backup jobs running. https://docs.microsoft.com/en-us/sql/relational-databases/backup-restore/recovery-models-sql-server?view=sql-server-2014

1 Like

Yes, it is set to Full recovery option. I will change it to Simple mode. But I need to create some free space first in the drive. If I shrink the log file will it reduce the log file size?

You shouldn’t run your Epicor DB in Simple mode. If you setup proper backups the log file shouldn’t increase make sure you are taking Transaction , Differential backups.

Hi Jose thanks for your response. Can you please share any document how to check the existing log settings in server? Also can you please advise is there anyway now to reduce the log file size as it is already too large and occupying the most of the drive space.

The only way to get your transaction logs to shrink is to do a backup. Changing to Simple recovery mode is not recommended by Epicor.

You should check to see if a backup job is configured in SQL Agent and whether SQL Agent is running.

It sounds like you probably have a failure in your backup process and all of your data is at risk.

2 Likes

This is a regular MS SQL management thing, not an epicor specific issue. I’d start by googling around and reading up on SQL Management Best Practices
https://www.sqlshack.com/sql-server-transaction-log-administration-best-practices/

1 Like

Thanks for sharing the link.

Hi Jose I have taken the truncate backup of log files and shrink the log file. For the Test database the log file size was around 30 GB, after taking the backup and shrink the log file significant free space has been created in the drive. The Live database log file is around 60 GB but I noticed after following the same process for the Live database log file it did not create any additional free space in the drive. Any idea why it behaved differently?

We have the daily backup of database and as per recommendation from Epicor it is fine to change the recovery mode to Simple if we have daily backup of our database file. Now we have enough free space in drive. Thanks all for your help.