Skip to content
DataMiner DoJo

More results...

Generic selectors
Exact matches only
Search in title
Search in content
Post Type Selectors
Search in posts
Search in pages
Search in posts
Search in pages
Log in
Menu
  • Blog
  • Questions
  • Learning
    • E-learning Courses
    • Empower Replay: Limited Edition
    • Tutorials
    • Open Classroom Training
    • Certification
      • DataMiner Fundamentals
      • DataMiner Configurator
      • DataMiner Automation
      • Scripts & Connectors Developer: HTTP Basics
      • Scripts & Connectors Developer: SNMP Basics
      • Visual Overview – Level 1
      • Verify a certificate
    • Video Library
    • Books We Like
    • >> Go to DataMiner Docs
  • Expert Center
    • Solutions & Use Cases
      • Solutions
      • Use Case Library
    • Markets & Industries
      • Media production
      • Government & defense
      • Content distribution
      • Service providers
      • Partners
      • OSS/BSS
    • DataMiner Insights
      • Security
      • System Architecture
      • DataMiner Releases & Updates
    • Agile
      • Agile Webspace
      • Everything Agile
        • The Agile Manifesto
        • Best Practices
        • Retro Recipes
      • Methodologies
        • The Scrum Framework
        • Kanban
        • Extreme Programming
      • Roles
        • The Product Owner
        • The Agile Coach
        • The Quality & UX Coach (QX)
    • DataMiner DevOps Professional Program
  • Downloads
  • More
    • Feature Suggestions
    • Climb the leaderboard!
    • Swag Shop
    • Contact
      • General Inquiries
      • DataMiner DevOps Support
      • Commercial Requests
    • Global Feedback Survey
  • PARTNERS
    • All Partners
    • Technology Partners
    • Strategic Partner Program
    • Deal Registration
  • >> Go to dataminer.services

How to properly delete old records from the service_alarm table of the offload DB

Solved530 views6th July 2023
0
Jan-Terje Larsen156 18th April 2023 0 Comments

We experience very slow response on deleting rows from the dbo.service_alarm table of the offload DB. Our offload DB is an MSSQL DB.
We plan to delte data from this table when deleting old records from the dbo.alarm table by using the primary keys from dbo.alarm (Id and DmaId) By doing something like this (pseudo code):

SELECT Id, DmaId FROM alarm WHERE age is older than xx days

DELETE FROM service_alarm WHERE iAlarm = alarm.id AND iAlarmDMA = alarm.DmaId

Are there other ways this could/should be done?
As a reference it would be interesting to see how the cleanup job for the local MySQL DB's are done for this table.

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 6th July 2023

2 Answers

  • Active
  • Voted
  • Newest
  • Oldest
3
Marlies Vandenberghe [SLC] [DevOps Member]2.97K Posted 18th April 2023 0 Comments

In our active MySQL database we have 4 tables that are linked with the alarms

alarm: contains all alarms

Then we have 3 different tables linked to that alarm table:
alarm_property, service_alarm and interface alarm

We clear first every 15 min the alarm table with the conditions defined in:
System Center > System Settings > time to live

afterwards we do a query on the other tables and delete the entries where no reference exist anymore in the alarm table

This way you also don't need to keep a list of alarms you deleted and if something got stuck during the delete process it's not much of an issue since the next cycle it will try again.

Also as reference, the structure of all the tables can be found here:

Structure of the offload database | DataMiner Docs

Marieke Goethals [SLC] [DevOps Catalyst] Selected answer as best 6th July 2023
1
Tom Van Bruaene [SLC] [DevOps Member]758 Posted 18th April 2023 0 Comments

The cleanup job on the local DB first cleans the alarm table and then just does:

DELETE FROM service_alarm WHERE (iAlarmDMA, iAlarm) NOT IN (SELECT dmaID, id FROM alarm);

If you only want to remove from service_alarm and not from alarm, you might be able to do it with:

DELETE FROM service_alarm WHERE (iAlarmDMA, iAlarm) IN (SELECT dmaID, id FROM alarm where toa < 'TIME');

Though the way you posted would also work and would result in smaller queries (though it might be a lot of queries)

Tom Van Bruaene [SLC] [DevOps Member] Answered question 18th April 2023
Please login to be able to comment or post an answer.

My DevOps rank

DevOps Members get more insights on their profile page.

My user earnings

0 Dojo credits

Spend your credits in our swag shop.

0 Reputation points

Boost your reputation, climb the leaderboard.

Promo banner DataMiner DevOps Professiona Program
DataMiner Integration Studio (DIS)
Empower Katas

Recent questions

LCA – create/modify Templated Services 0 Answers | 0 Votes
Low Code Apps – Link trend graph to the same time view port 1 Answer | 0 Votes
How is Automation run scripts count run calculated by Skyline? 0 Answers | 2 Votes

Question Tags

adl2099 (115) alarm (62) Alarm Console (82) alarms (100) alarm template (83) Automation (223) automation scipt (111) Automation script (167) backup (71) Cassandra (180) Connector (110) Correlation (69) Correlation rule (52) Cube (151) Dashboard (194) Dashboards (188) database (83) DataMiner Cube (57) DIS (81) DMS (71) DOM (140) driver (65) DVE (56) Elastic (83) Elasticsearch (115) elements (80) Failover (104) GQI (159) HTTP (76) IDP (74) LCA (154) low code app (167) low code apps (93) lowcodeapps (75) MySQL (53) protocol (203) QAction (83) security (88) SNMP (86) SRM (337) table (54) trending (87) upgrade (62) Visio (539) Visual Overview (345)
Privacy Policy • Terms & Conditions • Contact

© 2025 Skyline Communications. All rights reserved.

DOJO Q&A widget

Can't find what you need?

? Explore the Q&A DataMiner Docs

[ Placeholder content for popup link ] WordPress Download Manager - Best Download Management Plugin