Solved

Compress DBF files ?

Posted on 2010-08-14
5
1,368 Views
Last Modified: 2013-12-01
Hello gurus,

I am trying to make a backup on the web of my application...|Unfortunately the data is quite big...one of the tables I have is around 2GB. Is there a way to compress it "more" than by using winrar or winzip ?

I could on the other hand keep track of the "changed/new" records and take only those...
Unfortunately the data files are under foxpro 2.5 DOS and there is no way to know what records where changed/added...
any hint there ?
0
Comment
Question by:ammounpierre
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
5 Comments
 
LVL 14

Expert Comment

by:tusharkanvinde
ID: 33436925
No. That should be the best compression you will be able to get. Foxpro database do not have any recording of changes made. If one of the tables is 2GB is size, it is very near to the maximum size a table can be. It would be better to do something regarding that like changing your backend database or splitting the big file.
0
 
LVL 33

Expert Comment

by:pgnatyuk
ID: 33437003
How I remember, in FoxPro there is a special command: pack. It will pack the table. FoxPro does not delete the record in the DBF but marks it as deleted. So this pack command removes the deleted records.
Another procedure that will reduce the size is re-indexing. It is a long operation, but fully re-created indexes will reduce the database. So you will have less data to compress.
Ignore my comment, if you already do all these things before the compressing.


0
 

Author Comment

by:ammounpierre
ID: 33437267
Yep. All is done...
Coming to my question n#2 is there a "simple" way to know the changed/deleted/added records ?
In that case the procedure would take only the new data...
0
 
LVL 33

Accepted Solution

by:
pgnatyuk earned 250 total points
ID: 33437323
Before the pack command call you know about the deleted records.
Added records are in the end of the table.
Nothing about edited.

In ForPro you have count command.

Actually, all depends on your database: maybe new records have a field with the timestamp, same about the edited records. Maybe you have an operational journal, transaction table, etc. There is no a built-in tool controlling that in the DBF-files.

0
 
LVL 29

Assisted Solution

by:Olaf Doschke
Olaf Doschke earned 250 total points
ID: 33438071
I'd be more worried about the 2GB file anyway. You may save some bytes, even if the table is packed, if it has a memo and you SET BLOCKSIZE TO 1, if that was available in FPD. It minimizes fpt file blocks for memos. So it can shorten the fpt file, if you have memos.

Like pgnatyuk said deleted records are marked deleted before a pack, so first saving ids of all deleted records, then doing a pack and doing that at each backup, you know the changes in that respect, storing the max id for each backup you know the new records.

That is, if your records have an id, an integer primary key field. I know free fox tables and win or dos 2.x tables have no primaray key index, still you can have such a unique integer.

You can use checksums to find out changes. You do a checksum per record after a backup and at the next backup compute the checksum of each record to find changed ones when their checksum changes. Either you store checksums in a separate table or a new checksum field.

In vfp DBC you couls use insert, update and delete triggers happening in these events to log changes when they are made, update a checksum or even mirror data to a secondary database.

Bsides all that a complete backup is a safer and easier to restore backup anyway. Even if GB is quite large.

Bye, Olaf.
0

Featured Post

How our DevOps Teams Maximize Uptime

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us. Read the use case whitepaper.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Visual FoxPro (short VFP) is a programming language with it’s own IDE and database, ranking somewhat between Access and VB.NET + SQL Server (Express). Product Description: http://msdn.microsoft.com/en-us/vfoxpro/default.aspx (http://msd…
In this article we have discussed the manual scenarios to recover data from Windows 10 through some backup and recovery tools which are offered by it.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

710 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question