Backing up a Database

This is a good time to back up your database, because you’ve finished entering some tables. In the next part of the tutorial, you run a script to create more tables. Throughout this tutorial, you will be instructed to back up your database frequently. That way, if you run into difficulties, you can restore the last correct version and try again.

In a production database, a full backup and restore performs several functions:

   It preserves your data by making a copy of both the data and the data structures (metadata).

   It improves database performance by balancing indexes and performing garbage collection on outdated records.

   It reclaims space occupied by deleted records, and packs the remaining data.

   When you restore, it gives you the option of changing the database page size and of distributing the database among multiple files or disks.

ImportantIf you restore a database to a name that is already in use, be sure that no users are connected to it at the time you restore.

ActionItemIndicator00010.pngBacking up your Database

Before you begin, create a subdirectory called backups. If you are using the recommended directory path for this tutorial, your backups would be in C:\Embarcadero\InterBase\database\backups.

1.  If it’s not already open, open IBConsole by choosing it from the InterBase folder on the Start menu.

2.  Log in as TUTOR to the server where your TUTORIAL database is located. (See “Connecting to a Server from IBConsole” on page 4 if you’ve forgotten how to do this.)

3.  Right-click the Tutorial database and choose Backup/Restore > Backup to display the Database Backup dialog.

DatabaseBackup_Current.png

 

4.  In the Alias field enter Tutorial

By convention, backups have a .gbk extent, but it is not required. From the Verbose Output, select To Screen from the drop-down list in order to see a detailed description of what InterBase does when it backs up a database

5.  Browse to the location of your database backups (C:\Embarcadero\Interbase\database\backups)and enter tutorial1.gbk.

6.  Click Save and the click OK. The backup actions are recorded in the Database Backup dialog. You also get a message that “Database backup completed.”

DatabaseBackupWithInfo.png

 

7.  The database backup file (tutorial1gbk) has been created in the following folder:

C:\Embarcadero\InterBase\database\backups