Database Recovery Mode Maintenance
Problem (ISSUE-010)​
The database log file has grown too large or requires maintenance.
Symptoms​
- The database log file has grown excessively large.
- Disk space is being heavily consumed by log files.
- Maintenance jobs, backups, or other operations fail due to log size or lack of disk space.
Solution​
Run the following SQL commands in SQL Server Management Studio:
Database Name
Important: Replace BackOffice with the appropriate database name:
- BackOffice - For BackOffice database
- AlAmerDB - For AlAmerDB database
ALTER DATABASE BackOffice SET RECOVERY SIMPLE;
GO
CHECKPOINT;
ALTER DATABASE BackOffice SET RECOVERY FULL;
GO
For AlAmerDB database:
ALTER DATABASE AlAmerDB SET RECOVERY SIMPLE;
GO
CHECKPOINT;
ALTER DATABASE AlAmerDB SET RECOVERY FULL;
GO
Recovery Mode Maintenance
This temporarily switches the recovery model to SIMPLE to truncate the log, performs a checkpoint, and then restores it to FULL recovery mode. This helps manage log file size while maintaining full recovery capabilities.
Remember to change the database name (BackOffice or AlAmerDB) based on which database you're maintaining.
Database Access
This solution requires SQL Server administrative access. Always backup the database before performing maintenance operations.
Prevention​
- Configure regular log backups and maintenance plans to control log growth.
- Monitor database and log file sizes, as well as disk space usage, on a regular basis.
- Include this recovery-mode maintenance in a planned maintenance schedule, coordinated with your DBA or infrastructure team.
Related Issues​
- Invoice Not Cleared But Marked as Sent to New Business Central Server
- ERR Insert for TRANS to BC22 Job in LS Data Director