Objective 1.4 Protect and maintain databases
- 1.4.1 Compact and repair databases
- 1.4.2 Back up and restore databases
- 1.4.3 Split a database
- 1.4.4 Encrypt database files
OBJECTIVE 1.4: Contents
1.4.2 Back up and restore databases
Another step in protecting your database files from corruption and the potential loss of data is to perform regular backups. In practice, you need to back up some databases more often than others. A database that serves as an archive, for example, and isn’t used frequently, doesn’t need to be backed up on a specific schedule. A database that you and others work with nearly every day should be backed up on a regular schedule. You should also follow standard backup procedures such as keeping the backup copies on external media (such as a DVD or a flash drive) and in a secure location.
Exam Strategy: The objective domain for this exam includes backing up a database and recovering database objects from a backup. You might be required to demonstrate the recovery of specific objects, such as tables.
When you back up a database, Access appends the current date to the name of the database file. You can retain this date or replace it with an alternative identifier. You might also add “backup” to the file name so that you can identify a backup easily.
If one or more objects in a database become corrupt, if you lose data, or if you need to return to an earlier version of a database for some other reason, you can restore a database by replacing it with a backup file. You can also recover specific database objects by importing them from a recent backup.
Important: You might be able to at least partially repair a corrupt database by running the Compact & Repair command. For information, see “Compact and repair databases” earlier in this topic.
Recovering an object from a backup doesn’t automatically replace the original object. For example, if you restore a table named Tasks from a recent backup, Access creates a table named Tasks1 in the current database. Before you begin the steps to recover a database object, you should delete the object from the current database or rename the original object (by adding an identifier such as “old” or “bad”).
To back up a database
1. Display the Save As page of the Backstage view.
2. In the Advanced area, click Back Up Database, and then click Save As.
3. In the Save As dialog box, modify the file name that Access provides (or accept the default name), and then click Save.
To rename a database object
1. In the Navigation Pane, right-click the object, and then click Rename to activate the object name for editing.
2. Enter the new object name, and then press Enter.
See Also: For information about deleting database objects, see “Delete database objects” in “Objective 1.1: Create and modify databases.”
To restore database objects from a backup
1. Open the database in which you want to restore an object.
2. In the Navigation Pane, rename or delete the current instance of the object. (If you are restoring a missing object, you can ignore this step.)
3. On the External Data tab, in the Import & Link group, click Access.
4. In the Get External Data dialog box, click Import tables, queries, forms, reports, macros, and modules into the current database.
5. Click Browse and navigate to the backup file you want to use. Then click Open.
6. In the Get External Data dialog box, click OK.
7. In the Import Objects dialog box, do either of the following, and then click OK:
• Click Select All to select all the objects and restore the entire database.
• Select the object or objects you want to restore.
Restoring database objects from a backup
8. In the Get External Data dialog box, click Close.