File Maintenance and Recovery

 <  Day Day Up  >  

A corrupted database system is every developer's nightmare, as well as every user 's. Database systems are complex, and very sensitive to the integrity of their data structures. Errors in the way data is written to a database can damage a system, or in the worst case render it unusable. Periodic maintenance can help you avoid file structure problems. In the worst case, if one of your files does become corrupted, FileMaker has tools to help you recover from this situation as well.

File Maintenance

As you work with a database file, the file can become slowly more fragmented and less efficient over time. Large deletions can leave "holes" in the file's data space. Heavy transaction loads can cause indexes to become fragmented . If your databases are large or heavily used, it's a good idea to perform periodic file maintenance.

The File Maintenance feature is available only in FileMaker Developer 7. File maintenance can be performed only on files that are open locally. It can't be performed on files that are hosted. To invoke it, choose F ile, File M a intenance. You'll see a dialog like the one in Figure 17.9, which allows you to choose to compact the file, optimize the file, or both. We recommend you execute both of these steps when performing file maintenance.

Figure 17.9. Periodic file maintenance (a feature of FileMaker Developer) is a good idea if your files are large or heavily used.

graphics/17fig09.gif


There isn't a firm rule of thumb for when and how often to perform file maintenance. A general rule might be that if you have a database file over 20 “30 megabytes in size , or that is changed hundreds of times daily, it might be wise to perform a file maintenance every few months. If your file sizes rise into the hundreds of megabytes, or your activity rises into the thousands of records changed daily, you may want to perform maintenance monthly, or even more frequently.

File Recovery

It might occasionally happen that a FileMaker file becomes so badly damaged it cannot be opened. When this happens it's usually because the file's host (either the FileMaker client or the FileMaker Server) suffered a crash. If a file is damaged in this way, it's necessary to use the F ile, Reco v er command available in any copy of FileMaker Pro. This command tries to rebuild the file and repair the damage in such a way that the file can again be opened and its data accessed. The recovery process can take from a few seconds to many minutes or occasionally hours, depending on the size of the file and how many indexes it contains.

The recovery process is not intended to repair a damaged file fully. Files that have been damaged badly enough to require recovery should not be put back into service . The recovery process is intended to bring the file back to a state in which the data can be moved into a "clean" copy of the file. You need to create that clean copy by taking a recent backup (you do have a backup, don't you?) of the file, opening it, and choosing F ile, Save A Cop y As, then choosing to save it as Clone (No Records). This creates an empty copy of the file, containing all the structural elements such as table definitions, scripts, layouts, and the like. From here, you should run an import to fetch in the data from the recovered file.

CAUTION

This is so important we're going to repeat it here. Do not use a file that has been recovered! Even assuming the recovery proceeded without errors, this does not constitute a guarantee that all damage to the file has been repaired. If you go on using it, eventually the recovered copy will propagate throughout your backups and you'll no longer have access to a truly clean copy. If there later turns out to be hidden damage remaining, you'll be out of luck.


 <  Day Day Up  >  


QUE CORPORATION - Using Filemaker pro X
QUE CORPORATION - Using Filemaker pro X
ISBN: N/A
EAN: N/A
Year: 2003
Pages: 494

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net