home *** CD-ROM | disk | FTP | other *** search
/ PDA Software Library / pdasoftwarelib.iso / HP95_100 / DATABASE / GARLIC / GARLIC.DOC next >
Encoding:
Text File  |  1994-08-02  |  9.0 KB  |  199 lines

  1. GARLIC User's Guide 1.1
  2. ========================
  3.  
  4. What is GARLIC?
  5. ---------------
  6. GARLIC is a 100LX database reconstructor.  It works by scanning a
  7. corrupt database for anything it can recognize as still valid records.
  8. It then outputs those, along with reconstructed tables and links, into a
  9. new file for you to examine and edit. (Although not written explicitly
  10. for the Omnibook, it should work on corrupt Omnibook files as well.)
  11. GARLIC WILL NOT WORK ON PASSWORDED FILES.
  12.  
  13.  
  14. When do I use GARLIC?
  15. ---------------------
  16. Since GARLIC performs various mutilations on a file to make it readable,
  17. I would not recommend using it unless there is no other recourse.  That
  18. is, if you suddenly get a "Record Not Found" message (or something
  19. similar) on opening your only copy of a cherished vegetable database,
  20. this would be a good time.  If do you have a backup, the strategy I
  21. would recommend is to use GARLIC to retrieve all your new info, but
  22. merge it into your existing backup.
  23.  
  24.  
  25. Why do I need to use GARLIC?
  26. ----------------------------
  27. Or, why is my database corrupt?  There are several known
  28. causes for this:
  29.   1) Rebooting machine *in the middle of a database operation*.
  30.      Note that rebooting the machine while it is idle and
  31.      waiting for a key is not a problem.
  32.   2) Having the machine die (battery failure) in the middle
  33.      of a database operation.  Like above, if the database is
  34.      open, but idle, this isn't a problem.  Since accessing
  35.      cards (especially Flash EPROM) draws significantly more
  36.      power than just idleing, these two events are more than
  37.      just statistically related, however.
  38.   3) Breaking a connection with a database file while it is
  39.      open over a remote redirector, i.e., the built-in
  40.      redirector, DOS 6's Interlink, or Lap Link.  There also
  41.      seems to be a class of bug common with redirectors that can
  42.      cause file corruption in certain circumstances, especially
  43.      if the connection is ended abnormally.
  44.   4) Using any type of binary filter on the file.  For example,
  45.      doing a file FTP but forgetting to use BINARY mode, or
  46.      loading the file into most word processors or text
  47.      editors and saving.  Editors have a tendency to mutilate
  48.      lots of special characters that can be present in a
  49.      binary file.  The built-in Memo program is no exception
  50.      to this--loading and editing, or just loading the file
  51.      when autosave will destroy the file beyond GARLICing.
  52.      For most of these cases, the file has lost most of the
  53.      significant information to be able to reconstruct the
  54.      file.  You can give GARLIC a try, but my guess is that
  55.      a backup will be your only recourse.
  56.   5) Beserk programs.  Portions of the database are held
  57.      in memory (namely the lookup table and database header)
  58.      and are written back to disk at times.  Programs (either
  59.      DOS or System Manager compliant) that are buggy can
  60.      potentially write into incorrect locations in memory,
  61.      and collide with these data structures.  Although
  62.      the likelihood is probably not high (since these programs
  63.      probably will also crash the machine), they could corrupt
  64.      a database.
  65.   5) As yet unfound bugs.  Hopefully these will be few and
  66.      far between (as they have been so far), but like any
  67.      piece of reasonably complicated software, the possibility
  68.      does exist.
  69.  
  70.  
  71. How do I use GARLIC?
  72. --------------------
  73. It's relatively simple.  Suppose your database FRED.PDB is
  74. corrupt and won't load.  At DOS, type:
  75.   GARLIC FRED.PDB FRED_FIX.PDB
  76. The first name is the corrupt file, and the second name is
  77. the file it will recreate.  The two filenames MUST be
  78. different--GARLIC needs to refer to the corrupt file as it
  79. creates the reconstructed file.
  80.  
  81. If you are running GARLIC on the 100LX, you may need to
  82. terminate the System Manager or use the Filer DOS option
  83. to get enough memory.  GARLIC allocates several large buffers
  84. during reconstruction.
  85.  
  86. After running it, you should see a bunch of diagnostic messages,
  87. then the program will terminate.  If you would like to see
  88. in more detail what is happening, use the /D switch (for
  89. example, GARLIC /D FRED.ADB FRED_FIX.ADB).  This is the
  90. DEBUG (or DEVELOPER, to suit your fancy) switch, and outputs
  91. all the changes being made to the file.  You'll probably
  92. want to redirect this into a file, as it is usually quite
  93. large.
  94.  
  95. NOTE: Using the /D switch does not affect the resulting
  96. database, only the messages printed.  If you don't want to
  97. see a lot of clutter, don't use it, and you'll still get
  98. the same performance.
  99.  
  100. A more drastic step is to use the /V switch.  This will remove
  101. all your subsetting information, and create a default subset.
  102. This is more likely to make the file open properly, but you'll
  103. lose all the defined subsets.
  104.  
  105.  
  106. Steps to take after GARLICing a file
  107. ------------------------------------
  108. 1) The first thing to do after GARLICing a file is to try to
  109. open the newly reconstructed copy (FRED_FIX in the above
  110. example).
  111.  
  112. If it doesn't open, DON'T DESPAIR YET!  Try rerunning GARLIC with
  113. the /V switch.  This switch was added in GARLIC 1.1 to remove all
  114. existing subsets, and create a default subset.  I observed this
  115. to often be the only thing keeping the file from opening, and using
  116. /V will often clear up the problem.  Try opening the file again (if
  117. it opens, you'll have to add all your subsets back).
  118.  
  119. If it still won't open, the file was so severly
  120. trashed that nothing could save it (especially since it
  121. does a better job fixing files than I can do manually!).
  122. (NOTE: If you can't open the file, you could try GARLICing
  123. the "fixed" file.  On at least one occassion, I've observed
  124. this to actually work!)
  125.  
  126. 2) If the file does open, look around for obviously bad info
  127. (like strings of random garbage), and delete them. If you notice
  128. any missing information, you might want to jot those entries
  129. down (don't enter them just yet).  If you're lucky, and the
  130. file was minorly corrupt, you might have all your data and
  131. no garbage records.  Consider yourself fortunate (and remember
  132. to back up your file!).  In general, the worse the corruption,
  133. the more missing or irrelevant information your file will
  134. have.  GARLIC attempts to reconstruct the structure of the
  135. database, but it can't patch garbage in the data itself.
  136.  
  137. 3) Create an empty file, and merge in the fixed file.  This
  138. allows either the database or appointment book a chance to
  139. fix up any remaining things that GARLIC might not have
  140. corrected.  If you cannot do this step (you get additional
  141. "Record Not Found" messages), you may need to go back to
  142. the fixed file and try to view the card view of each record
  143. in succession.  If you can't view a record, you should delete
  144. it.
  145.  
  146. If you have a recent backup, you might try deleting all the
  147. "old" info from the fixed file (so that file only has records
  148. entered or modified since the backup was made), and merge that
  149. fixed file into your backup file.
  150.  
  151. 4) Manually add back any records you noticed were missing in
  152. steps 1-3.  If you have notes that are missing, you can get
  153. a copy of them by re-running GARLIC with the /D switch.
  154. Embedded in the output are the contents of any unattached notes
  155. that GARLIC deleted.  With some cutting and pasting you
  156. should be able to re-insert them.
  157.  
  158. 5) Back your file up in a safe place.  I can't answer how
  159. rigorous you should be about this, but you might ask yourself
  160. the following questions: How often do I change my data (hourly,
  161. daily, weekly)?  What would I do if I lost my data?  How
  162. expensive would losing my data be?  How accessible do I
  163. need my backups should anything unfortunate occur?  How does the
  164. inconvience of a backup weigh against the inconvience of
  165. reconstructing lost data.
  166.  
  167. If you're using GARLIC for the first time, you can probably
  168. answer some of these questions.  You should consider keeping
  169. recent backups of sensitive data on a RAM/Flash card and/or
  170. on your PC.
  171.  
  172. If you make nightly or very frequent backups, you should be
  173. careful about the effect I call "cascaded corruption".  That
  174. is, if you back up a corrupted file, you now have (ta-da)
  175. *two* corrupted files!  The only way to get around this is to
  176. 1) make sure your files are okay before backing them up, or
  177. 2) keep more than one backup (perhaps one for every day of the
  178. week?).
  179.  
  180. NOTE: The other important thing to be aware of is that there is a bug
  181. related to opening a file that has been copied but has no subset/sort
  182. order.  Mostly, this will be an appointment book, but a database/phone
  183. book with no sort item selected will also show it.  This bug shows up
  184. infrequently, but may damage the file when you open it. Because of this,
  185. I would recommend that any nightly backups use a macro that first closes
  186. out all database apps (AppMgr/Close All is the easiest way to do this)
  187. before making the backup.
  188.  
  189. You should carefully think about a backup strategy that works
  190. for you.
  191.  
  192.  
  193. Conclusion
  194. ----------
  195. I hope that you never have to use this program.  If you
  196. do need to use it, I hope it works for you!  Good Luck!
  197.  
  198. --Andy Gryc (andyg@hpcvra.cv.hp.com)
  199.