Unique Constraint Errors on Serial Number

Symptom

In the log, you may encounter errors referring to duplicate serial numbers.

The following example is for an Oracle database:

Database error encountered: Serial Number: 1360725739, Event: 0-0, Panel: 5281: ORA-0001; unique constraint (LENEL.SYS_C0010364) violated

Resolution

  1. Make note of the Panel or Device ID shown in the error.
  2. Find the Max serial number on the Events table, and the Last Serial Number for that device:
     
  3. SELECT MAX(SERIALNUM) FROM EVENTS WHERE MACHINE = 5281
    SELECT * FROM EVENTS_LASTSERIALNUM WHERE DEVICEID = 5281


  4. If the table that stores the last serial number has a lower value then that of the EVENTS table, there is a problem.
  5. Update the Last Serial Number accordingly.
     
    UPDATE EVENTS_LASTSERIALNUM SET SERIALNUM = (SELECT NVL(MAX(SERIALNUM),0)+1 FROM EVENTS WHERE MACHINE = 5281) WHERE DEVICEID = 5281;
    COMMIT;

Applies To

OnGuard (All versions)

Additional Information

Copyright © 2022 Carrier. All rights reserved.