LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Overwrite Citadel database

I want to overwrite contents of the citadel database.
In my application, the alarms are logged continuosly.
So is there a maximum limit for the database size.
Can i give a option, say after one month period overwrite the previous data.
0 Kudos
Message 1 of 5
(3,069 Views)

Hi,

You can "overwrite" old data by setting the lifespan for your logged data. After this specified period of time expires, the data will be overwritten by new data.

This lifespan setting called 'Days to keep historical data' can be set in the Tag Configuration Editor >> Configure >> Historical... dialog.

NOTE: It is important to note that the overwriting may not exactly start at the time you specified because Citadel logs data to what are called "pages," and it waits until the current "page" is full before going back and overwriting the old "pages."

Hope this helps,

Khalid


0 Kudos
Message 2 of 5
(3,069 Views)
Actually, the lifespanning does not affect the logged alarms.

In Citadel5 (released with DSC 7.0), the alarms are logged to a relational database (MSDE - the free version of Microsoft's SQL Server) so there is no actual overwriting. What you want to do is remove the old alarms. This can be accomplished using an SQL query but it has not yet been published.

Using MSDE, you are limited to 16 alarm databases per computer with a max size of 2 gigabytes per database. Purchasing SQL Server removes these limits. Remember that you can configure the DSC Engine to log data and alarms to seperate databases if the 16 database limit becomes a problem.
Regards,
Robert
0 Kudos
Message 3 of 5
(3,069 Views)


Sorry for the confusion -- lifespanning applies only to data, not alarms as REM1 explained above.

Here's a VI which implements the SQL query to delete the Alarms from the MSDE database.

The attached .llb is saved in LabVIEW 7.0. Run the top-level VI (DeleteAlarms.vi). Enter the name (not the URL) of the database to be deleted, and the desired time range, and run the VI. NOTE: the time range is UTC time.

The VI makes use of the osql.exe command line tool, which is included with the MSDE installation, so it should not require any special setup. You also accomplish this manually by running:

osql -E -i C:\command.txt

Where command.txt contains the SQL command to delete the alarms.

Also attached is a 'Delete
combined.txt' file which contains an example query for deleting alarms from a database named "C__Documents_and_Settings_Adminstrator_Desktop_Dbs_OPCAlarms_data" in the time range (11/11/2003 11:31:00PM, 11/11/2003 11:46:00PM).

Hope this helps.

Regards,

Khalid

Download All
0 Kudos
Message 4 of 5
(3,069 Views)
BTW - this is similar to the KB How Can I Delete Old Alarms from the Citadel (MSDE) Alarm Database?

We hope at some point LV DSC implements lifespanning as well to the alarms/events and destructive archiving would work on the Citadel 5 A&E db.

For the ease-to-use.
Roli
0 Kudos
Message 5 of 5
(3,069 Views)