Alarm Maintenance

Alarm Maintenance Overview

Use the alarm backup feature to maintain a backup copy of alarms when you plan a maintenance activity. Use the alarm restore feature to retrieve the alarms that have been backed up or deleted or to move alarms from one system to the other. Use the alarm purging feature to delete alarms that you do not want to store and to manage disk space better.

To backup, restore, or purge alarms, the latest Historian Administrator and Data Archiver is required. If you point Historian Administrator to an earlier version of the Archiver, the Alarms section appears unavailable and the option to backup only alarms is not accessible. However, the 6.0 (or later) Administrator can be connected to a pre-6.0 archiver to archive alarm data automatically with the archive.

Backing Up Alarms

About this task

When Proficy Historian backs up alarms, it creates a copy of the alarm data in an offline file that can be restored later. The alarms are not removed from the online system. You can backup alarms using Historian Administrator or through a command line program.

For more information on the command line program, refer to Using ihBackupAlarms.exe to Backup Alarms from the Command Line.

To backup alarms using Historian Administrator pointing at a 6.0 or newer archiver:

Procedure

  1. Open the Alarms Maintenance page. In the Backup/Purge Alarms section, set the time range. Setting the time range helps you back up alarms within a time range.
  2. In the Start Time field, select the start date using the drop-down arrow. Optionally, select the element you want to change and enter the details.
    Select the start time using the up and down arrow keys in the field.
  3. In the End Time field, select the end date using the drop-down arrow. Optionally, select the element you want to change and enter the details.
    Select the end time using the up and down arrow keys in the combo box.
  4. Select Backup Alarms. In the Save As window that appears, the file name of the alarm backup is displayed.

    The file format is as follows: mm-dd-yyyy hh:mm:ss. The time format followed is the 24-hour time notation. For example, if the file name is 7-13-2013 16-29-24 it means that the archive was saved on July 13, 2013 at 4 hours, 29 minutes, and 24 seconds. This file naming convention for alarm backup is standard to Historian. Even if you use other date settings such as dd-mm, the file name will still be saved in the mm-dd format.

    The end time stamp in the file name indicates the time at which the alarms have been backed up but not the time till when the alarms are backed up. For example, if you do a backup at 8:00 A.M. using a time of now-2 hours, the backup will contain alarms from 6:00 A.M to 8:00 A.M. but may not contain an alarm at 8:00 A.M. The last alarm may have been at 7:50 A.M. But the backup file name will have the time stamp of 8:00:00 along with the date.

  5. Select Save.

    A status message with the backup progress appears. If the backup has been successful, a message appears indicating the same.

    Note:
    • The backup is saved as a .zip file, by default.
    • The file is saved in the backup path mentioned while saving the file.
    • If your SQL Server is on a different computer, ensure that you specify a path available to the SQL Server.
    • If you want to migrate data from an alarms and events server that is earlier than 8.1, before backing up the data, you must apply the AEBackupEB package on the alarms and events database. You can find the AEBackupEB package on Salesforce. However, if you have already backed up the data, restore the data, apply the AEBackupEB package, and back up the data again.

Using ihBackupAlarms.exe to Backup Alarms from the Command Line

When you install Proficy Historian, the alarm backup utility is installed on your computer. The default path for this file is typically: ..\Program Files\Proficy\ProficyHistorian\Server\ihBackupAlarms.exe.

Use the ihBackupAlarms.exe command to backup alarms for a time period relative to when the program is run. For example, you can backup alarms from -1 day to now. You can only use relative times with this command. If you need to backup a specific start and end time, use Historian Administrator. For more information, refer to the Backing Up Alarms section.

ihBackupAlarms takes the following optional arguments. If no arguments are supplied, ihBackupAlarms.exe will not backup any alarms.

ParameterDescription
-s serverNodeNameThe Proficy Historian node containing the alarms to backup. If the -s is not specified, the program will connect to the local archiver.
-u UsernameThe user name required to connect to the Historian archiver. This is an optional parameter.
-p PasswordThe password required to connect to the Historian server. This is an optional parameter.
-b Backup File PathThe file path where you want to place the backup file. If the path is not specified, the backup will be placed in the default archive path as specified at install time.
-d Relative Number of Days from Current TimeThe relative number of days of alarms to backup, counting backwards from the current time. For example, to backup now minus 7 days to now you would use -d 7.
-h Relative Number of Hours from Current TimeThe relative number of hours of data to back up, counting backwards from the current time. For example, to backup now minus 12 hours, you would use -h 12.
-m Relative Number of Minutes from Current TimeThe relative number of minutes of data to back up, counting backwards from the current time. For example, to backup now minus 360 minutes, you would do use -m 360.
-sec Relative Number of Seconds from Current TimeThe relative number of seconds of data to back up, counting backwards from the current time. For example, to backup now minus 120 seconds, you would use -sec 120.

Examples of Typical Command Lines for Alarm Backup

To backup alarms for 24 hours from now minus 24 hours from now, use the following command line:
ihBackupAlarms.exe-h 24

The alarms will be backed up for 24 hours from now in the default location with the file name as month_ day_year_hour_minute_second.zip. For example,_8_13_2012_6_55_30.zip.

ihBackupAlarms.exe-d 7 -h 12 -m 360 -sec 120 -b c:/AlarmBackups/example

The alarms will be backed up for the mentioned time and stored with the file name as backup_8_12_ 2012_19_7_37.zip at C:/AlarmBackups/example.

Note: You must put a space between each parameter and the associated parameter information. You can place the parameters in any order.

Restoring Alarms

About this task

Restoring alarms to a running system makes them available for query and analysis. You can restore alarms that have been backed up or deleted previously.

To restore alarms:

Procedure

  1. Open the Alarms Maintenance page. In the Restore Alarms section, select the browse button to navigate to the file that you want to restore, select and then select Open.
    The path of the file is listed in the Select File field.
  2. Select Restore.
    A message appears indicating that alarm restore is in progress. If the restore is successful, the alarms are restored to the Archiver.

About Purging Alarms

Purging alarm data involves deleting the data from the database.
Note:
  • Even after purging, the data is not lost; a backup is created to maintain an audit trail. You can restore the data if needed.
  • When using circular archives (that is, archives that roll over), alarms are purged automatically.
You can choose to purge alarm data for any of the following reasons:
  • To maintain alarm data efficiently
  • The data is outdated or redundant
  • The disk space is limited
Data in the following tables is purged:
  • Alarm Attribute Values
  • Alarm Attribute Value History
  • Delete from Alarm History
  • Delete from Alarm Table esignatures
  • comments
You can purge data using one of the following methods:
  • Purge data within a specified duration.
  • Purge data related to a specific alarm ID.

Purging is performed in batches. You can check the log data in the Proficy.Historian.AandE.Migration.log file. By default, this file is located in the C:\Program Files(x86)\Proficy folder.

In the case of a failure:
  • The batch size is changed to 10. That is, the Alarms and Events collector receives an acknowledgement after sending 10 messages, thus reducing the load on the server.
  • The waiting time for receiving an acknowledgement is automatically incremented after each failure per batch, starting from 90 seconds to 270 seconds. This gives more time for the server to respond.
Note: After the acknowledgement is received, the batch size and the waiting time are reset for the subsequent batches.

If the time taken to purge exceeds the timeout limit, instead of reverting the entire purging operation, only the current batch, which is still under processing, is purged.

Best Practices:
  • Restart the Alarms and Events services before purging data.

Purge Data Within a Specified Duration

Before you begin

Ensure that you are a member of the ihsecurityAdmins security group.

Procedure

  1. In the Proficy Historian Alarms and Events Data Management window, select Purge Alarm.
    The Purge Alarm section appears.

  2. Connect to the Microsoft SQL database that contains the data that you want to purge provide values as described in the following table.
    Field Description
    SQL Instance Name Enter the Microsoft SQL server instance that contains the data that you want to purge.
    Database Name Enter the name of the database that contains the data that you want to purge.
    Authentication Select Windows or SQL depending on whether you want to provide credentials of the Windows machine or the SQL server, respectively.
    User Id Enter the User ID of the Windows user or the SQL user (depending on whether you have selected Windows or SQL).
    Password Enter the password of the Windows or SQL user account (depending on whether you have selected Windows or SQL).
  3. Select Connect.
    A message appears, specifying that a connection to the Microsoft SQL database is established. The Space Consumed (MB) and the Alarms and Events count fields are populated with the appropriate values.
  4. If you want to purge data within a time range, provide the start time and end time in the From and To fields, respectively.
  5. If you want to purge data for a certain duration till the current date and time, enter a value in the Retention field, and then select the units of measurement. The default value is 1 minute.
    If you want to purge data until last week, enter 7, and then select Days. Data from the beginning until seven days prior to the current date and time is purged.
  6. Select Begin Purge.
    The data received within the specified duration is purged. You can check the log data in the Proficy.Historian.AandE.Migration.log file. By default, this file is located in the C:\Program Files(x86)\Proficy folder.

Purging Alarms Using Alarm IDs

To purge alarms using an alarm ID, use the Alarms.PurgeAlarmsById to develop an SDK program. For more information, refer to the SDK sample in SDK Help.

Using ihPurgeAlarms.exe to Purge Alarms from the Command Line

When you install Proficy Historian, the alarm purge utility is installed on your system at install time. The default location for this file is typically: ..\Program Files\Proficy\ProficyHistorian\Server\ihPurgeAlarms.exe.

The ihPurgeAlarms.exe command takes the following optional arguments. If no arguments are supplied, ihPurgeAlarms will not purge any alarms.

ParameterDescription
-s serverNodeNameThe Proficy Historian node you wish to access archive data on. If the -s is not specified, the program will connect to the local archiver.
-u UsernameThe password required to connect to the Proficy Historian archiver. This is an optional parameter.
-p PasswordThe password required to connect to the Historian archiver. This is an optional parameter.
-b Backup File PathThe file path where you want to place the file containing the purged alarms. If the path is not specified, the backup will be placed in the default archive path as specified in the Administrator.
-z 1 ZIP FileSaves the alarms in a ZIP file format.
-d Relative Number of Days prior to Current TimePurge alarms older than this time. For example, to purge alarms older than 7 days old, you would use -d 7.
-h Relative Number of Hours prior to Current TimePurge alarms older than this time. For example, to purge alarms older than 12 hours, you would use -h 12.
-m Relative Number of Minutes prior to Current TimePurge alarms older than this time. For example, to purge alarms older than 360 minutes, you would use -m 360.
-sec Relative Number of Seconds prior to Current TimePurge alarms older than this time. For example, to purge alarms older than 120 seconds, you would use -sec 120.
Note:
  • Specify the path for saving backup files if you want to back up the alarms before purging. If you do not mention the path for backup files but select the zip the file option, then the backup will be placed in the default archives folder with the endstamp.zip as the file name. To select the zip file option, use -z 1 in the command line.
  • Specify the backup folder path name in double quotes such as "C:\\backup\\".
  • Alarms will be deleted from current time the relative time prior to current time.

Examples of Typical Command Line for Alarm Purge

To purge alarms older than 36 hours old, use the following command:

ihPurgeAlarms.exe -h 36

The alarms older than 36 hours will be purged and an audit log will be created at ..\Proficy Historian Data\LogFilesfolder.

To purge alarms older than 36 hours, doing a backup first, use the following command:

ihPurgeAlarms.exe -h 36 -z 1

A .zip file will be created as a backup file in the default location and the alarms older than 36 hours will be purged.