The difference between logical and physical backups
InterBase uses the gbak command to perform backups. The gbak command makes the following distinctions between backup types.
- The full backup typically performed by gbak is a “logical” backup. It extracts every record in the database and stores it in a different format. Thus, it is not an exact replica of the database file. Logical backups reclaim space occupied by deleted records, thereby reducing database size.
- A logical backup, performed by a gbak client, can save the target backup file anywhere on the network; you do not have to have an InterBase server on the client machine. If the backup is performed using the Services API, then the backup file can only be written to file systems that are accessible to the server (since the server is performing the backup operation).
- When executing a logical backup with gbak, use the following syntax:
- gbak [-b] [options] <database> <target>
- If you choose the Backup option using IBConsole, this is the type of backup InterBase executes.
- Restoring from logical backups gives you the option of changing the database page size and distributing the database among multiple files or disks.
- InterBase physical backup, also referred to as an online dump, copies the database at the page level and saves it in its original format. Thus, a physical backup creates an exact replica of the database during backup process. You can convert the replica to a read-write database, though if you do so, you will no longer be able to dump to the replica from the original database.
- To perform a physical backup, use the following syntax:
- gbak [-d] [options] <database> <target>
- Notice that the physical backup uses the -d switch rather than the -b switch that is specified in the logical backup.
- An incremental backup copies all of the changes that have been committed to the database since the last full backup. An incremental backup is a physical backup and uses the -d switch. The first time you use the gbak -d switch, InterBase performs a full physical backup (an online dump). After the initial full dump, each subsequent backup using the -d switch performs an incremental backup, saving and copying all of the transactions committed since the last full backup.
- If you choose the Incremental Backup option using IBConsole, IBConsole performs an initial full online dump using the -d switch. All subsequent backups using the -d switch are incremental.