{}

Our Brands

Impact-Company-Logo-English Black-01-177x54

Schneider Electric USA Website

Welcome to our website.
How can we help you today?
How to Manually Trim the ION Databases

Product Line
ION Enterprise
StruxureWare Power Monitoring 7.0.x
Power Monitoring Expert 7.2.x
Power Monitoring Expert 8.x
Power Monitoring Expert 9.0
Power Monitoring Expert 2020
Power Monitoring Expert 2021
Power Monitoring Expert 2022
Power Monitoring Expert 2023


Environment
SQL Server Management Studio

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

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.
  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:
ION_Data
@StartDate - use 'YYYY-MM-DD' format (Note: Keep single quotation marks around the date, e.g. to start trimming from January 31st, 2002, enter '2002-01-31')
@EndDate - use 'YYYY-MM-DD' format
Note: The trim job will trim data between the @StartDate and @EndDate. The @EndDate should be the more recent of the two dates.
@TrimDataLog - Set to 1 to trim Historical Data
@TrimWaveForm - Set to 1 to trim Waveforms
@TrimEvent - Set to 1 to trim Meter Events
@BatchDeleteNumber - Set to 2500 to optimize between overall duration versus avoiding lock escalation and exclusively locking DataLog2
Note: This option does not exist in older versions of the script

Below is an example that shows the values entered to trim the data from January 1st, 2016 until December 31st, 2022:
Current ION_Data trim

Below is an example that shows the values entered to trim the data from January 31st, 2002 until December 31st, 2010 with the older version of the script:
Old ION_Data trim

ION_SystemLog
@DaysToKeep - any records older than this number of days will be deleted
@Time - an optional setting that defaults to the current time and accepts hh:mm:ssformat to determine the time of day to trim to in local time

Below is an example that shows the values entered to trim the data from 30 days ago at 23:59:59:
SysLog Trim
  1. Once the parameters are set, click OK at the bottom of the window to begin the trim job.
  2. When the job has completed successfully, it will return a '0' in the query window.

Schneider Electric USA

Explore more
Range:
Articles that might be helpful Users group

Discuss this topic with experts

Visit our Community for first-hand insights from experts and peers on this topic and more.
Explore more
Range: