E852 Documentation: Tape Database
E852 Documentation: Tape Database
Tape Database files
The tape database file is $E852_TAPES/Tapes.gdbm
Programs to access and manipulate the Tape Database
- tapedb1.update - update the master database file with the information about tapes
that were written since tapedb1.update was last ran.
- tapedb1.reindex - scan the database and create the index entries for every tape and run.
These index entries are used by the database searching tools.
- tapedb1 - read the database entries for a particular tape.
-
Usage: tapedb1 tapeNo
- whichtape1 - for a given run, find the tapes containing data from this run.
-
Usage: whichtape1 runNo
- tapedb.perl5 - read the database entries for a particular tape or run.
This program prints information about trigger types written to the tape,
when the tape was written and other information.
- Usage: tapedb.perl5 [-h] [-l] [-d] pattern
- Examples:
- get run information: tapedb.perl5 runNo
- get tape information: tapedb.perl5 tapeNo
- get trigger information for a run: tapedb.perl5 -l runNo
- get trigger information for a tape: tapedb.perl5 -l tapeNo
Database format
The database format was designed to allow easy access to the data from programs written using the perl5
programming language and to allow the database to be updated in real time.
The database is managed by the GNU gdbm library, which was selected for following reasons:
- good support: gdbm is part of the GNU project
- no length restrictions on key and data fields
- transparent access from programs written in perl5.
Database Key format
The database key format is:
"Time=unixTime Tape=tapeNo Run=runNo"
- for regular entries,
"Time=unixTime Tape=tapeNo"
- for tape summary entries,
"IndexTape=tapeNo"
- for tape index entries,
"IndexRun=runNo"
- for run index entries,
Data field format
Regular entries and tape summary entries
The data field format is:
"fieldname1=value1 fieldname2=value2 ... fieldnameN=valueN"
The list of currently used fieldnames is given below:
- total.bytes - total bytes (in the run or on the tape)
- total.events - number of events in this record
- time.first - unixTime when this run/tape was started
- time.last - unixTime when this run/tape was ended
- event.maxSize - maximum event size (in bytes)
- Ttrigger.latch.eventType - number of events with given trigger, latch and eventType combination.
Tape and run index entries
The index entry contains the list of the keys of all database entries that contain information about
a given run or tape. The entry format is:
"key1|key2|...|keyN|"
notice the trailing "|" at the end.
Bugs
Although the database is kept in the ASCII format, both the key and the data
fields are *not* zero-terminated, which creates problems when
accessing the database from a C program.
See also
See the source code for the programs documented in this page as examples on how
to access the database information.
//CO 1995-01-17
updated: CO 1995-04-05
end file