Normal database use causes the internal structure of a
database to become fragmented, resulting in a bloated file and
inefficient use of disk space. Access monitors the condition of
database files as you open and work with them. If a problem develops,
Access attempts to fix it. If Access can’t fix the problem, it usually
provides additional information to help you to find a solution. But
Access doesn’t always spot problems before they affect the database,
so you need to pay attention, particularly if the performance of the
database seems slow or erratic.
There are various things you can do to help keep a database
healthy and running smoothly. Your first line of defense against
damage or corruption in any kind of file is the maintenance of
backups. Database files can rapidly become very large, so you need to
choose an appropriate place to store a backup copy, such as a DVD,
another computer on your network, or removable media such as a USB
flash drive or external hard disk.
In addition to regularly backing up the database, you can use
the following Access utilities to keep it running smoothly: -
Compact and Repair
Database. This utility first optimizes performance by rearranging
how the file is stored on your hard disk, and then attempts to
repair any corruption in tables, forms, and reports. Tip
It’s a good idea to compact and repair a database often.
You can have Access run this utility automatically each time the
database is closed. Display the Backstage view, and click
Options to open the Access Options dialog box. Display the
Current Database page, and in the Application Options area,
select the Compact On Close check box. Then click OK.
-
Database
Documenter. This tool produces a detailed report containing enough
information to rebuild the database structure if that is ever
necessary. -
Analyze
Performance. This utility analyzes the objects in your database and
offers three types of feedback: ideas, suggestions, and
recommendations. You can instruct Access to optimize the file by
following through on any of the suggestions or
recommendations. -
Analyze Table. This wizard tests database tables for compliance with
standard database design principles, suggests solutions to
problems, and implements those solutions at your request.
In this exercise, you’ll first back up a database. Then
you’ll run the Compact And Repair Database, Analyze Performance, and
Database Documenter utilities. Set Up
You need the GardenCompany12 database you worked with in the
preceding exercise to complete this exercise. Open the
GardenCompany12.accdb file FOR EXCLUSIVE USE, and then follow the
steps.
See Also
For information about opening a file for exclusive use, see
the previous exercise.
-
Display the Save &
Publish page of the Backstage view. -
In the right pane, click Back Up
Database, and then click Save
As. -
In the Save As dialog
box, verify that the contents of your practice file folder are
displayed, and then click Save.
Access creates a copy of the database with the current date
appended to the file name in the specified folder. As with any
file name, you can change the name to suit your needs. -
Display the Backstage view, and if the Info page is not
displayed, click Info. -
In the center pane of the Info page, click Compact & Repair Database. Tip
You can also click the Compact And Repair Database button
in the Tools group on the Database Tools tab.
Troubleshooting
If you don’t have enough space on your hard disk to store
a temporary copy of the database, you don’t have appropriate
permissions, or another user also has the database open, the
Compact And Repair Database utility will not run.
The utility takes only a few seconds to run, and you see no
difference in the appearance of the database. If you have been
using a database regularly and have not compacted it for a while,
running the Compact And Repair Database utility can sometimes
reduce the file size by as much as 25 percent. -
Close all open database objects, and then under Forms in the Navigation pane, click Home Page. -
On the Database Tools
tab, in the Analyze group,
click the Analyze Performance
button.
The Performance Analyzer dialog box opens. Each type of
database object is represented by a page, and there are also pages
for all objects and for the database as a whole. -
Click the All Object
Types tab, click Select
All, and then with the check boxes for all the objects
in the database selected, click OK to start the analyzer.
When it finishes, the Performance Analyzer displays its
results. (The results you see might be different from those shown
here.)
-
Click each entry in turn, and read the information
in the Analysis Notes
area.
Most of the suggestions are valid, although the one to
change the data type of the PostalCode field to Long Integer is
not appropriate for this database. -
Close the Performance
Analyzer dialog box. -
On the Database Tools
tab, in the Analyze group,
click the Database Documenter
button.
The Documenter dialog box opens. This dialog box is
identical to the Performance Analyzer dialog box. It contains a
page for each type of object the utility can document, and a page
displaying all the existing database objects. -
Click the Tables tab, and
then click Options.
The Print Table Definition dialog box opens.
The options associated with each object type vary, but they
all enable you to specify what items you want to include in the
documentation for that type of object. -
In the Print Table
Definition dialog box, click Cancel. -
Click the All Object
Types tab, click Select
All, and then click OK to start the documentation
process.
When the process finishes, Access displays a report in Print
Preview. -
Zoom in on the report to see the kinds of things included in
the documentation. Then scroll through a few pages.
You probably don’t want to print this long report, but it is
a good idea to create and save a report such as this one for your
own databases, in case you ever need to reconstruct them. Tip
You can’t save the report generated by the Documenter
utility, but you can export it in a variety of formats.
Right-click the report, click Export, and then click the format
you want.
Clean Up
Close the Object Definition report and the GardenCompany12
database.
|