Browse FAQs

SQL - Removing Extra Database Logical File Names

Published date: 17 April 2020

When performing the resolution in FA210466, a user might notice that the ION_Network database actually contains both the PegasysNOM_Data and ION_Network_Data Logical Names as seen below. Attempting to remove one of the Logical Names results in an error. 

Product Line:
Power Monitoring Expert 
StruxureWare Power Monitoring
ION Enterprise

PME Installer
SQL Server Management Studio

The error occurs because the ION_Network database is actually split across multiple MDF files. This is a result of a pre-ION Enterprise 5.0 database having been upgraded numerous times to newer versions. 

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

In order to remove the extra database files and allow us to properly name the Logical Files as ION_Network_Data and ION_Network_Log, we need to merge the contents from one into the other. 

1) First we need to determine which of the two is the main MDF file. To do this, run the following attached SQL script (HelpDB.sql)  in SQL Server Management Studio. The result of the query shows that the PegasysNOM_Data and PegasysNOM_Log are the main files for the database. We will need to merge the ION_Network_Data and ION_Network_Log files into those, and then remove them. Once removed, we can rename the PegasysNOM files to ION_Network as described in FA210466

The result of the SQL script should be something similar to this:

2) To do this, run the following attached SQL script (MergeRemove.sql)  in SQL Server Management Studio. 

3) Once the query has completed, we will be left with just the PegasysNOM_Data and PegasysNOM_Log files. Re-name these files to ION_Network_Data and ION_Network_Log. 

Was this helpful?

What can we do to improve the information ?

Can't find what you are looking for?

Reach out to our customer care team to receive information on technical support, assistance for complaints and more.