Shrink the Transaction Log File of a Large SOTI MobiControl Database
Summary
Related SOTI ONE Platform Products
Situation
When transaction log files are not properly maintained, they can grow larger than the database itself, degrading SQL Server and SOTI MobiControl performance. This procedure helps shrink the log file and improve server responsiveness.
Environment
- Windows Server 2016
- Microsoft SQL Server
- SOTI MobiControl Database
Process Description
This process involves three steps:
- Checking the transaction log file size.
- Changing the database recovery model.
- Shrinking the transaction log file.
Step One: Check the Transaction Log File Size
1. On the SOTI MobiControl SQL Server, navigate to the SQL data folder (typically located at:
D:\Program Files\Microsoft SQL Server\
2. Compare the file sizes of:
MobiControlDB.mdf(database file)MobiControlDB_log.ldf(transaction log file)
3. If the transaction log file is larger than the database file, proceed to shrink the log.
Step Two: Change the Database Recovery Model
1. Open SQL Server Management Studio (SSMS).
2. In Object Explorer, right-click the SOTI MobiControl database and select Properties.
3. Select the Options tab.
5. Verify that the Recovery model is set to Simple. If not, change it to Simple, then select OK to save.
Important: Using the Simple recovery model reduces the ability to restore point-in-time backups. Make sure this aligns with your organization's backup strategy.
Step Three: Shrink the Transaction Log File
1. In Object Explorer, select the SOTI MobiControl database.
2. Select New Query.
3. Run the following commands:
DBCC LOGINFO('MobiControlDB')
CHECKPOINT
EXEC sp_flush_log
DBCC SHRINKFILE (MobiControlDB_Log, 250)
Verification and Validation
Review the results:
- Fewer rows in the result
DBCC LOGINFOindicate that the transaction log has successfully shrunk. - You may need to repeat the script multiple times until the log size is sufficiently reduced.
Was this helpful?
Thanks for your feedback