Solved

Compress DBF files ?

Posted on 2010-08-14
5
1,237 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
5 Comments
 
LVL 14

Expert Comment

by:tusharkanvinde
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

Join & Write a Comment

It is a common problem that often server suffers from the lack of space on system volume. Old servers or new ones from vendors come with preformatted small volume - 5-6GB in total and after installing updates or applications the free space on system…
One good source is the manufacturer's web site. Even though the device operating system is changing, the hardware isn't. Going to the support site and looking at the Vista drivers provides a starting point for identifying system hardware for which d…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

728 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now