Technical FAQs

Ask a Question

Is it possible to move the historical data from one device to another in PME?

A customer has data within a misleading source that they would like to reassign to the original meter within the PME system.

Product Line
SPM 7.0.1 / PME 7.2.2 / PME 8.0 / PME 8.1

Power Monitoring Expert SQL data

Intermittent communications can cause the log inserter to create a false or misleading source.  For instance, the original meter name might be 'Substation1.MeterA', but a misleading source named 'Substation1.MeterA-Current A' has been created which only contains historical data for the phase A current on that device.

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

**Warning: It is recommended that only those familiar with SQL Management Studio and PME architecture run queries which modify the databases.  Always create recent database back ups before hand.  Failure to do so can leave the databases in an inoperable state and lead to loss of historical data. **

It is possible to realign the historical data back to the original source using a SQL Update statement assuming there is no time stamp overlap between the original and misleading source.

1) Create a recent back up of ION_Data
2) Identify the source ID's for the original and misleading sources from the ION_Data.dbo.Source table
3) Run the query below replacing the ID's identified from step 2:

Update ION_Data.dbo.DataLog2
SET SourceID = <Original meter ID>
WHERE SourceID = <Misleading meter ID>

If the original meter's SourceID is 14 (Substation1.MeterA), and the Misleading meter's SourceID is 15 (Substation1.MeterA-Current A), the query would be:

Update ION_Data.dbo.DataLog2
SET SourceID = 14
WHERE SourceID = 15

4) Confirm the misleading source (Substation1.MeterA-Current A) no longer has historical data within the DataLog2 table by using the statement below:
SELECT * FROM ION_Data.dbo.DataLog2
WHERE SourceID = <Misleading meter ID>

SELECT * FROM ION_Data.dbo.DataLog2
WHERE SourceID = 15

This query should return zero rows if all historical data have been reassigned back to the original device.

5) Run the PME delete device script from resolution FA210105 against the misleading source in order to delete the misleading source name.
Was this helpful?
What can we do to improve the information ?