БД Алармов и событий
Материал из archestra.info
см. также:
Содержание
- 1 Печать алармов
- 2 Разные вопросы
- 2.1 Утилита purge была применена, но размер файла БД не уменьшился
- 2.2 Очистка базы
- 2.3 Размер БД больше 6ГБ
- 2.4 Как контролировать БД алармов
- 2.5 Как ограничить БД алармов
- 2.6 Как использовать поля user1, user2, user3 в БД Алармов
- 2.7 Задержки при отображении Алармов и Событий при использовании в AlarmClient History mode
Печать алармов
Варианты вывода алармов на печать:
- Использовать штатные функции InTouch: PrintScreen(), PrintWindow() (подробнее см. ITScriptsAndLogic.pdf, раздел Printing Windows at Run Time)
- Использовать дополнительный Wizard Intouch'a WWGenericSQLGrid, который позволит вам сохранить информацию в формате Excel и/или вывести данные на печать.
- Использовать импорт внешних данных в самом Excel, запросив данные с базы алармов (напр. WWALMDB )
- Использовать утилиту для Intouch’a TSAlmDBPrt Utility, с помощью которой можно соединиться с БД, отобразить данные и распечатать их в файл. (правда, она достаточно давно создана и может некорректно работать на современных ОС)
- Также можно печатать поступающие алармы/события в файл с помощью утилиты Alarm Printer, из состава Intouch утилит - она может печатать алармы в текстовой файл или сразу на принтер (О ней можно подробнее узнать из док-та ITAlarmsAndEvents.pdf на дистрибутиве с Intouch)
Разные вопросы
Утилита purge была применена, но размер файла БД не уменьшился
- ISSUE: customer purge the whole AlmDB. The DB is empty but the size (files .mdf, .ldf) doesn't change.
- CAUSE: This is normal behaviour of SQL Server (or Express) that cleans the DB but mantain the size of the file.
- SOLUTION 1: open SQLManager, slect the DB and use the task Shrink.
- SOLUTION 2: Deleted the DB and created a new one
Очистка базы
- Issue: Сообщение в логе Consider purging or archiving old stored Alarms & Events data to maintain storage & retrieval performance
- Answer:
- Данная запись появляется в логе при наличии в базе A2AlmDb более чем 3.5 миллионов записей об алармах (или при размере базы около 6гб)
- Необходимо рассмотреть использование Purge/Archive utility для очистки старых записей
Размер БД больше 6ГБ
- Issue: The alarm database size is over 6 Gb, disk space is running out.
- Answer:
- Use Shrink utility (under Tasks menu) in SQL Server Management Studio to reduce the log file size (the log file for SQL Server database)
- Use Purge/Archive utility to purge old records
Как контролировать БД алармов
- Issue: How to maintain alarm database (size growing)
- Answer:
- The best is to use Alarm Purge/Archive utility to limit the size of alarm database
- Create a new alarm database periodically
- Shrink the datatabase (an SQL Server function). But this should be only used as way of mitigation, not a solution.
Как ограничить БД алармов
- Issue: Would like to limit AlarmDB size
- Answer:
- Use Alarm DB purge.
- Set "Number Days OnLine" on Purge Properties
- Then Schedule Purge on Purge/Archive, Run As Service and Activate
Как использовать поля user1, user2, user3 в БД Алармов
- Данные поля присутствуют в БД WWALMDB и в A2ALMDB
- Использовать их можно только в приложении InTouch (в System Platform, Application Server - они не применимы)
- Use the "User1", "User2" and "User3" fields in the AlmDBViewCtrl.
- They correspond to dotfields .AlarmUserDefNum1, .AlarmUserDefNum2, & .AlarmUserDefStr respectively. They correspond to dotfields .AlarmUserDefNum1, .AlarmUserDefNum2, & .AlarmUserDefStr respectively. Please refer to the InTouch Reference Guide for further information.
- Use the "User1", "User2" and "User3" fields in the AlmDBViewCtrl.
Задержки при отображении Алармов и Событий при использовании в AlarmClient History mode
- Issue: При отображении Алармов в историческом журнале происходит задержка 5-10 минут
- Answer: Данное поведение может наблюдаться при использовании в Query знаков >= или <= по отношению к столбцу приоритета
Исправляется если использовать при запросе знаки > или <
Пример: -Working SQL query : select * from Events Where Eventtime >= '20200720 16:20:33.000' And Eventtime <= '20200720 18:30:31.999' and Priority > '1' AND Priority < '600'; -Non-Working SQL query : select * from Events Where Eventtime >= '20200720 16:20:33.000' And Eventtime <= '20200720 18:30:31.999' and Priority >= '1' AND Priority <= '600';