Technical FAQs

Ask a Question

Video: How to shrink the ION_Data .ldf file

Issue
Customer has .ldf file that is significantly larger than the .mdf file and taking up unnecessary space on the hard drive.

Product
Power Monitoring Expert (PME) 7.2, 8.0, 8.1
Struxureware Power Monitoring (SPM) 7.0, 7.0.1
ION Enterprise 5.6, 6.0
SQL 2008 R2, 2012, 2012 R2, 2014 

Environment
SQL Server Management Studio

Cause
When the Database recovery mode is set to Full but the transaction logs are not backed up, the .LDF file can grow much larger than the .mdf file.

Resolution
*Warning: Irreparable database damage can occur. This procedure should only be performed by users familiar with SQL Server Management Studio. Databases should be backed up prior to performing this procedure.* 

Before proceeding with this resolution, confirm the following:
- Be sure to have a recent backup on the ION_Data database
- The database recovery mode is set to simple or schedule transaction log backups
- Have a clear understanding why the .ldf file is growing. 
- Understand the impact of shrinking the .ldf file. Only unused space can be returned to the hard drive. Shrinking the log file too much will cause delays in the system when SQL needs to grow the file again.

This video has instructions on how to shrink the .ldf file in SQL Server Management Studio, a copy of the scripts used in the video are included below

DBCC SQLPERF (logspace)

EXEC sp_helpfile

DBCC SHRINKFILE(ION_Data_Log, 3072)


 
Was this helpful?
What can we do to improve the information ?