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.x, 8.x, 9.x
Struxureware Power Monitoring (SPM) 7.x
ION Enterprise 5.6, 6.0
SQL 2008 R2, 2012, 2012 R2, 2014, 2016, 2017
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.
The Database Console Commands or Database Consistency Check commands (DBCC) and SQL stored procedures(s) used in the video are listed below.
DBCC SQLPERF (logspace)
EXEC sp_helpfile
DBCC SHRINKFILE(ION_Data_Log, 3072)
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.x, 8.x, 9.x
Struxureware Power Monitoring (SPM) 7.x
ION Enterprise 5.6, 6.0
SQL 2008 R2, 2012, 2012 R2, 2014, 2016, 2017
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.
The Database Console Commands or Database Consistency Check commands (DBCC) and SQL stored procedures(s) used in the video are listed below.
DBCC SQLPERF (logspace)
EXEC sp_helpfile
DBCC SHRINKFILE(ION_Data_Log, 3072)