Navigation:  Files (database) and Alarms >

 

DATABASE RECOMMENDATIONS

 

Previous pageReturn to chapter overviewNext page

 

 

SETTING UP YOUR DATABASE

 

The files tab of the Files & Alarms Form configures database storage.  You store data by selecting the log on options as defined below.

 

 

FILES TAB (Database: LOG ON Column)

 

 

1.        OnMin:        Stores data on minute intervals (0 – 1439).  If you enter 15 in the minute column, you will store data every 15 minutes.

 

2.        Hourly:        Stores data on an hourly basis on the minute selected (0 – 59 minutes).  This option only stores once per hour.  If you want storage for every 3 hours, use OnMin with the minute column set to 180.

 

3.        Daily:        Store data daily.  Use for summaries, daily totals, maximums, etc.  Data is stored on the minute (0-1439).  You can set up more than one daily database.  One daily database may store at 15 minutes while another database stores at 360 minutes (6 AM).  This could be used for different summary information.

4.        OnChg:        Used for sensors that need to store measurements on change.  Rain gauges or other analog sensors that require storing data when it changes.  The minute column has no effect.

 

5.        Status:        Stores status sensors, on off, true, false, 1, 0 when the status changes state.  Status database only stores 1 or 0 for the data value.  On change databases store real numbers. The minute column has no effect.

 

 

MIN (Column)

 

The minute column tells the program when to store data in the database.  The minute columns must be the same value for databases with the same type and name.  If the minute column is different for some of the sensors with the same database name, data could be stored as zero instead of the current measurement.

 

DATABASE NAMES  (name.eej)

 

Databases are stored with the *.eej extension.  The SQL editor will only open .eej files for your reports.  Sensors with the same log on type, minute, and database name will be stored properly.  This storage only applies to timed database. (OnMin, Hourly and Daily).

 

Use Database names that are meaningful.  DailyFlow.eej, HourlyLevels.eej, Hourly.eej, Rain.eej, Levels.eej, Pumps.eej, Status.eej, Alarms.eej, etc.

 

There are 3 types of database file structures.

 

1.  Data file = timed files

 

2.  Status file = on change files

 

3.  On change file = on change files

 

 

STORAGE SPACE

 

 

The timed databases are most efficient on disk space.  Each data file includes a header and data.  The header allows the file to be standalone and be opened by another copy of EVENTS on another machine.  You can transmit any database file to another computer, open it, read it, and create reports from it.  The data file structure allows you to read it on any computer running Events.

 

(OnMin, Hourly, Daily Databases)

 

Timed files are stored with one date and then real values.

datetime                   values...

10/30/1998 10:30:00 value value1 value2..        value=real number        = Record 1

 

OnChg files

datetime                   sensor number, value

10/30/1998 10:30:00 SN# value                value = real number        =Record 1

 

Status files

datetime                   sensor number, value

10/30/1998 10:30:00 SN# value                value = 0 or 1        =Record 1

 

 

The main difference between status and on change files is the data stored.  Status only stores a 1 or 0.  On change files store real numbers.

 

It is best to combine like sensors into one database.  Then SQL searches and functions can be used on that database to produce a report.  The SQL statements are used on one database at a time.

 

 

 

DATABASE RECOMMENDATIONS

 

 

DATABASE that store on time and have the same database name, must be stored on the same minute.  Timed databases are more efficient and will produce reports faster.

 

Put like sensors in the same database.  Remember that the SQL statements only work on one database at a time.