Alpha Video Training
Results 1 to 6 of 6

Thread: FPT grows AFTER packing table

  1. #1
    Member
    Real Name
    Marco Gallardo
    Join Date
    Sep 2016
    Posts
    33

    Default FPT grows AFTER packing table

    Hey Gang,

    I have a table with multiple memo fields and recently noticed its associated FPT file was at about 1 gig. I thought I would pack it and reclaim some space but to my surprise it grew to about 1.6 gigs. Any ideas whats going on? I ran a memo check/repair but everything seems to check out.

    Something is definitely up. I inherited this database about 2.5 years ago and at that time the same file was only 8mb despite the database having been in use since 2007.

  2. #2
    "Certified" Alphaholic
    Real Name
    Finian Lennon
    Join Date
    Apr 2000
    Location
    Atlanta, GA
    Posts
    1,795

    Default Re: FPT grows AFTER packing table

    This almost certainly means that the file is corrupted and, where there are multiple memo fields, it can be extremely difficult to track down the source of the corruption. Sometimes, if you're lucky, you can spot the area of the problem by browsing through the records. Sometimes exporting the records prior to the corrupt record, and the records after, to another table, then re-importing the data may help. Personally I've not had much success with that. The best defense is to use best practices in entering and changing data in the memo fields.

    To begin with create a duplicate (from scratch) of the corrupted table and see if you can import the data into the new table.
    Finian

  3. #3
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,281

    Default Re: FPT grows AFTER packing table

    Not sure if this is possible in V12, but you used to be able to create an index which included every word in a table.
    If it is still possible, you should be able to find the duplicates.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

  4. #4
    Member
    Real Name
    Marco Gallardo
    Join Date
    Sep 2016
    Posts
    33

    Default Re: FPT grows AFTER packing table

    Solved!

    Not surprisingly you were correct Finian, FPT was corrupt. I'm not sure how this happened (other than less than safe memo editing practices) but the FPT header was reporting the next free block @ 0x13D134600 but using a hex editor I could clearly see the next free block was at 0x3D134600. The left most hex digit was getting truncated. Browsing the DBF I also noted that, past a certain record, all of DBF's memo pointers were also truncated hex values.

    There also was a corrupt entry in the FPT that was being misinterpreted as an incredibly large entry. I believe this is what caused the file to inflate after packing.

    I found the corrupt FPT entry by using a split-half search on the associated DBF; deleting half the records and checking if packing still made the FPT grow. Once I found the record with the offending memo field I was able to use the memo_block_get() method on the memo field to get the location of corrupt FPT entry. I also discovered the next two memo fields had bad FPT pointers as well.

    I couldn't find a method or function to remove the memo field's reference to the FPT file so I did it with a hex editor (Was there a built in function I could have used instead?). I opened up the DBF in a hex editor, found the record with the bad pointers and overwrote each of the bad pointers 10 0x20's each (a memo's field length is 10).

    after removing the reference to the bad FPT entries I re-packed the table and everything was peachy. File header pointed to a block address that didn't need to be truncated. the bad FPT entries were gone due to the packing routine, and all of the memo pointers in the DBF were also non-truncated values.

  5. #5
    Member
    Real Name
    Marco Gallardo
    Join Date
    Sep 2016
    Posts
    33

    Default Re: FPT grows AFTER packing table

    Oh and I forgot to mention. The FPT shrank down to < 12 MB all said and done.

  6. #6
    "Certified" Alphaholic Ted Giles's Avatar
    Real Name
    Ted Giles
    Join Date
    Aug 2000
    Location
    In the Wolds, Louth, Lincolnshire, UK
    Posts
    4,281

    Default Re: FPT grows AFTER packing table

    Good explanation. Thanks.
    The binary chop is a good idea, and the editor was too.
    Have you considered saving the record when focus on the memo field is changed?
    Then at least you know that a record is likely to be ok if it has been touched.
    Ted Giles
    Example Consulting - UK
    .

    http://ec12.example-software.com//
    See our site for Alpha Support, Conversion and Upgrade.

Similar Threads

  1. Error when packing a table
    By Arlene Stoppe in forum Alpha Five Version 9 - Desktop Applications
    Replies: 4
    Last Post: 09-29-2014, 02:29 PM
  2. Replies: 17
    Last Post: 02-04-2011, 11:57 AM
  3. Packing Table On Server
    By Phil Rolf in forum Web Application Server v6
    Replies: 9
    Last Post: 10-02-2005, 12:36 PM
  4. Packing child table in a set
    By fairviewcomputing in forum Alpha Five Version 4
    Replies: 3
    Last Post: 03-11-2002, 06:38 AM
  5. Packing a table
    By Ken Penge in forum Alpha Five Version 4
    Replies: 1
    Last Post: 04-23-2001, 01:17 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •