OrganiZATOR User's Guide

[Home]  [Init]  [Index]

Maintenance utilities

The Zator's database engine is reliable and robust, so it is highly unlikely that the dBase suffers corruption even in the event of an unexpected failure of the power supply of the system. However, in accordance with the Murphy's Law, everything that is remotely possible will happen soon, so that we have prepared three options, that along with the backup (*) can help keep intact the database, and in some cases, correct any inconsistency and/or mistakes that may arise [1].

* Very often, the worst enemies of the data are not unexpected failures, breakdowns, power outages, etc. but users themselves. For example, when delete "inadvertently" unrecoverable data; perform unreasonable operations, etc. According to the second Codd's premise, it is impossible to make a stupid-proof system, because they are terribly ingenious, so is best to be prevented.

§1  Check integrity

Conduct an audit of the internal integrity of the database. Sometimes it can recover a few items from dBase, which have been dangled by destruction or corruption of its links. Also performs an integrity checks of the Zator's link system, erasing those elements that stay dangled because some deleting process had not completed satisfactorily.

Note:  If the checking process find any error and display a message proposing any corrective measure, it is necessary to re-start the process until they cease to be errors. For example, if dBase is corrupted, this process may show the message "There are xxx links orphans. Want delete him?". It refers to internal links that have been dangling because some of the items involved in the link does not exist. In this case it is advisable to accept the option and re-start the process of verification. It is possible that new bugs are discovered in this second pass as result of the lack of the links that were removed. In these cases may appear a new message: "There are items yyy orphans. Want pass them to the root space?"  It refers to items that have lost the links that point to their relative position in the overall structure, so that have been left dangling without knowing what their place is. In this case, is offered the option to put them in the root space, from which you can delete, or back into place manually. In these cases, you may need to press the reload button to make visible the new items in the root area. Note that this process can move to the first window (level 0) items that are not properly atoms from the main structure. For example, elements of a log, extended fields, empty fields (without any content). Do not forget that if the structure of the dBase is damaged, this type of recovery measures are exceptional and only intended to save as much as possible of the disaster. In these situations the best therapy is to have a recent backup and install it in replacement of the corrupted file [3].

§2  Reindexing

Make a reconstruction of the index system of the SQL engine.

§3  Regenerate & Compacting

This utility frees potential spaces that may exist in the Zator database as a result of the items deleted [2]. The process requires to copy the actual dBase in a new file, so we must take into account that at one time, there may be two files on disk, the original file and its copy, so there should be enough space for both.


[1]  The current database system of Zator responds to a double-layer design. The upper layer, who really is a proof of concept of a more ambitious project, includes only two types of elements, which we call atoms (items) and links (links). For its operation, this layer is mounted over a standard relational database engine through two main tables and some small auxiliary. This part of the model could be replaced in the future by a newer database engine specifically designed, but in that event, the application tools should include the necessary automatic conversion.  At the moment, the security and portability of your data rest on this layer who is responsible of physically write/read the data in the media (disc).  In this respect, you can be confident that your data are handled by a very well known and secure engine. In fact, SQLite is today one of the "de facto" standards in the industry, and is widely used by the most respected companies. It powers Mozilla Firefox; Symbian Smartphones; Google Android and Gears; Adobe AIR and Lightroom; Apple Mail and Safari, and Skype, to name but a few.

[2]  Although the Zator database engine (RDBM) can reuse this space when inserting new data, the space occupied by the deleted elements is not automatically returned to the system. I.e., the zDB1 file does not reduce its size spontaneously.

[3]  A problem of filesystems in general and the database systems in particular, is the corruption of files, the effects of which can be spread over time without being detected at an early stage, which leads to the backups can also be "infected". This is known as "bit rot", and in this regard, the recommended option would be run the check integrity option before of performing the backup.