Technical FAQs

Ask a Question

How to Manually Trim the ION Databases

How to manually trim the ION databases without using the ION Database Manager.

Product Line:
ION Enterprise 
StruxureWare Power Monitoring 7.0.x
Power Monitoring Expert 7.2.x
Power Monitoring Expert 8.x 

SQL Server Management Studio

The ION_Data and ION_SystemLog databases contain stored procedures called dbo.TrimRecords. These stored procedures can be executed manually using SQL Server Management Studio. 


*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.* 

1) In SQL Server Management Studio, expand either the ION_Data or ION_SystemLog database and go to Programmability > Stored Procedures. 
2) Right click on dbo.TrimRecords and select Execute Stored Procedure. 
3) In the Execute Procedure window, provide values for the following items:

@StartDate -  use 'YYYY-MM-DD' format (Note: Keep single quotation marks around date)
@EndDate - use 'YYYY-MM-DD' format
@TrimDataLog - Set to 1 to trim Historical Data
@TrimWaveForm - Set to 1 to trim Waveforms
@TrimEvent - Set to 1 to trim Meter Events

Note: The trim job will trim data between the @StartDate and @EndDate. The @EndDate should be the more recent of the two dates. 

@DaysToKeep - any records older than this number of days will be deleted

4) Once the parameters are set, click OK at the bottom of the window to begin the trim job. 
5) When the job has completed successfully, it will return a '0' in the query window. 
Was this helpful?
What can we do to improve the information ?