| |
October 20, 2001 | |
Recovering deleted records; safeguarding your data | |
All | |
Anthony J. Frates (Copyright 2001 Addsum Business Software, Inc.) |
Frequently we are asked about the recovery of data that may have been deleted in an accounting software or other system running under the TAS runtime engine and using the Btrieve/Pervasive database record manager. Issues related to understanding how information might be deleted are in turn related to security issues
Background
The information contained in this technical support memo applies to most database systems and is not specific to issues relating to the TAS development system nor the TAS runtime engine. Few issues discussed are specific/unique to the Btrieve record manager (hereafter the term "Btrieve" will be used to identify any of the various releases of the Btrieve record manager including Btrieve 5.10a, the Btrieve 6.15 Microkernel as well as the various releases to date of Pervasive.SQL). TAS has used Btrieve as its native record manager in versions 3.0 thru 5.1 and initially in the 6.0 release.
In the discussion that follows, a data file means the entire physical file. A data file corresponds to a file descriptor (synonyms include schema, file layout or file definition). A file descriptor may be thought of as a "table" as used in some other non-Btrieve environments. In a TAS environment, information in a data file NEVER corresponds to more than one file descriptor. File descriptors themselves are unique and are defined by programmers. Different physical data files may use the same file descriptor. An example of this is in Advanced Accounting (and DBA) where the pending sales order "header" file is BKARINV.BXX (where XX is company extension, if any) and the posted/invoiced orders are contained in the BKARHINV.BXX file. Both of these data files use the same file descriptor which coincidentally has the layout name of BKARINV.
Inside each data file are individual records. Records are in turn made up of one or more fields as defined in the file descriptor. A BKARINV.BXX file for pending sales order might at any point in time have any number of records corresponding to the number of pending sales orders. Each record will have the exact same number of fields (currently in Advanced Accounting, there are 54 fields per record - that number could change in the future as additional fields may be added, but each record in a data file will always have the exact same records accordingly to the latest file descriptor installed). A field of information within a record cannot be changed or updated without updating (for example saving) the entire record which includes the entire collection of fields belonging to that record. (This is incidentally why the record must be locked in a multi-user environmen before the record can be saved as otherwise two or more users could be accessing the record at the same time and one could overwrite changes made by the other absent a locking mechanism of some kind preventing that.)
How information loss can occur
Here are the primary ways then that records can be deleted:
More issues with respect to information loss and data file security
Information loss related to all of these items can occur or be triggered by several other general conditions that warrant further discussion: remote access, employee dishonesty and file corruption.
Increasingly users are accessing their data remotely by remote control software (most commonly PcAnywhere) or via more multi-user robust options such as by Citrix or Microsoft’s Terminal Server. There are Advanced Accounting users accessing their internal accounting systems using wireless laptops. Further the increasing available of inexpensive, high-speed connections (DSL), means that PC’s with static IP addresses are potentially accessible whenever they are up and connected to the network. While the advantages of this relatively new kind of remote access and connectivity generally outweigh the disadvantages, they pose many new problems for controlling data deletion and theft.
Current/former employee dishonesty combined with the fact that access can occur to the system from an unsupervised office or remote location and fall into the hands of users who have not been given access spells additional trouble. Even if no remote access is possible, today’s employees are much more knowledgeable and are more prone to poke around and probe for weaknesses. Most of these employees are simply curious however some have other intentions.
Small businesses that have absentee owners or owners who lack a minimum level of computer savvy and accounting knowledge as well as businesses that lack appropriate internal controls are especially vulnerable.
In addition to eternal vigilance, controls can be added to the application software to determine, in the case of record deletion or records that are being changed to track exactly what was deleted or changed and by who. In the specific context of various Advanced Accounting program functions (and the same would be true of DBA systems released to date), we have implemented custom controls to specifically keep track of, by user log-on and date/time, records that may have been deleted from, for example, customer and sales order files. Further even in a open program such as "maintain database" that allows for raw access to the data, we can add controls that indicate exactly what field in a record was changed, when and by who.
Finally, record loss can also be triggered thru file corruption. File corruption can occur due to a great number of reasons which are beyond the control of the application software or the record manager or database engine. Typically file corruption results thru some sort of hardware failure but can also be caused by operating system settings, software conflicts and viruses that attack the integrity of a hard drive. With Btrieve files, both index and data are stored within the same physical file. Index information often occupies a greater portion of the total data file than the data ("fields") itself. When something goes wrong with a data more commonly an index is impacted rather than the data. The process of reindexing a Btrieve file more often than not will resolve the problem (although reindexing is not a normal/routine housekeeping function and should normally only be done when there is a specific reason to do so). Sometimes when reindexing a file that has become corrupted for some external reason, data loss can result because of previously existing problems within the data itself. We have seen a number of cases where a data file was being used normally on a day to day basis but contained a section within it involving one or more records that was corrupt to the point that a reindex will stop when it hits that section and no error message will necessarily result. All information after or before the area of corruption may be lost. For this reason it is essential that a complete copy be made of any file that is about to be reindexed and further that close attention is paid while the file is being reindexed to ensure that no record loss occurs. Assuming that the file can be read prior to reindexing (with some Btrieve errors, for example an 02, that might not be possible) it is a good idea to get a record count before and then one after to make sure that a loss has not occurred in the course of a reindex.
\homepage\techmemo\ad102001.htm