Skip to main content
InSource Solutions

TN - 1246 How to query Alarm Shelves out of the Runtime Database

Description

 

How to query Alarm Shelves out of the Runtime Database

  • Author: Mike Viteri
  • Published: 6/6/2022
  • Applies to: 2017 and later

Details

Sometimes Alarm Shelve information is needed in a format that can be reported on instead of being pulled from the alarm display.

Alarm Shelve History is kept in the Runtime database if using History Blocks as the storage system.

The query below looks at type of alarm column. The two types of Alarm Shelve are

  • Alarm.Shelve.Set
  • Alarm.Shelve.Clear

There are many other columns that can be added or removed from the query. You can look at Runtime.dbo.Events for column information.

 

Example Query:

Select [EventTime]
      ,[EventTimeUtc]
      ,[EventTimeUTCOffsetMins]
      ,[Type]
      ,[Priority]
      ,[Severity]
      ,[IsAlarm]
      ,[Source_ProcessVariable]
      ,[Comment]
      ,[InTouchType]
      ,[Provider_ApplicationName]
      ,[Provider_NodeName]
      ,[Provider_System]
      ,[Provider_SystemVersion]
      ,[ReceivedTime]
      ,[Source_Area]
      ,[Source_HierarchicalArea]
      ,[Source_HierarchicalObject]
      ,[Source_Object]
      ,[Source_Platform]
      ,[User_Account]
      ,[User_Name]
      ,[User_NodeName]
      ,[ValueString]
      ,[PreviousValueString]
      ,[wwTimeZone]
  FROM [Runtime].[dbo].[Events]
  Where Type = 'Alarm.Shelve.Set' or Type = 'Alarm.Shelve.Clear'
and EventTime>= '2022-06-01 11:00:00:000'
and EventTime <= '2022-06-02 11:00:00:000'

 

clipboard_ea2e08450c01d52a6d8a8b5c24c4a76eb.png