Lookout

cancel
Showing results for 
Search instead for 
Did you mean: 

Old alarms are not being deleted from database

I am running Lookout 6.1, and I am trying to manually delete the old alarms from my database. I followed the instructions from http://digital.ni.com/public.nsf/allkb/9D3A81218264C68686256DE1005D794F?OpenDocument,
but when I run the following lines of text by typing "osql -E -i C:\delete_cmd.txt" or "osql -S computername\Citadel -E -i C:\delete_cmd.txt" and then open NI Max and create an alarm view, I still see all of the alarms in the time frame selected in the lines of text below. 
 
USE nicitadel_d__lookout_6_1_database;
 
DELETE FROM table_set
WHERE table_set.aeSetTime > '11/26/2007 12:00:00AM'
AND table_set.aeSettime < '11/27/2007 12:00:00AM'
AND table_set.aeAlarmID NOT IN
(SELECT table_clear.aeAlarmID FROM table_clear
WHERE table_clear.aeClearTime < '11/26/2007 12:00:00AM'
OR table_clear.aeClearTime > '11/27/2007 12:00:00AM')
AND table_set.aeAlarmID NOT IN
(SELECT table_ack.aeAlarmID FROM table_ack
WHERE table_ack.aeAckTime < '11/26/2007 12:00:00AM'
OR table_ack.aeAckTime > '11/27/2007 12:00:00AM');
 
DELETE FROM table_clear
WHERE table_clear.aeClearTime > '11/26/2007 12:00:00AM'
AND table_clear.aeCleartime < '11/27/2007 12:00:00AM'
AND table_clear.aeAlarmID NOT IN
(SELECT table_set.aeAlarmID FROM table_set
WHERE table_set.aeSetTime < '11/26/2007 12:00:00AM'
OR table_set.aeSetTime > '11/27/2007 12:00:00AM')
AND table_clear.aeAlarmID NOT IN
(SELECT table_ack.aeAlarmID FROM table_ack
WHERE table_ack.aeAckTime < '11/26/2007 12:00:00AM
OR table_ack.aeAckTime > '11/27/2007 12:00:00AM');
 
DELETE FROM table_ack
WHERE table_ack.aeAckTime > '11/26/2007 12:00:00AM'
AND table_ack.aeAcktime < '11/27/2007 12:00:00AM'
AND table_ack.aeAlarmID NOT IN
(SELECT table_set.aeAlarmID FROM table_set
WHERE table_set.aeSetTime < '11/26/2007 12:00:00AM'
OR table_set.aeSetTime > '11/27/2007 12:00:00AM')
AND table_ack.aeAlarmID NOT IN
(SELECT table_clear.aeAlarmID FROM table_clear
WHERE table_clear.aeClearTime < '11/26/2007 12:00:00AM'
OR table_clear.aeClearTime > '11/27/2007 12:00:00AM'); 
 
We generate many alarms on a daily basis related to garbled communciations and these alarms do not need to be kept in the database. Any assistance in correcting this issue would be appreciated. 
 
Also, for Citadel 5.3.1.120 which command line should I be using: "osql -E -i C:\delete_cmd.txt" or "osql -S computername\Citadel -E -i C:\delete_cmd.txt" ?
 
 
 
 
Jason Phillips
0 Kudos
Message 1 of 3
(4,347 Views)
Use "osql -S computername\Citadel -E -i C:\delete_cmd.txt"
After you run this command, what result did you receive? Any error message?
If it is successful, you will be told how many rows or records have been deleted.
Ryan Shi
National Instruments
0 Kudos
Message 2 of 3
(4,337 Views)
Instead of pasting it into the run dialogue box through the start button, I opened a DOS prompt and typed in the command. From there, I saw the problem - a missing quotation mark.
 
Thanks!
Jason Phillips
0 Kudos
Message 3 of 3
(4,331 Views)