This article explains how to perform an online backup. We recommend that you back-up all the databanks, both system and user, in your database on a regular basis.
The main purpose of backing-up the databank files is to allow the database to be recovered in the event of a disk failure; to this end we recommend that, whenever possible, you include all the databanks in a database in the backup, to form a consistent set.
For more information on Mimer SQL’s methods of backing-up your database and a discussion of backup issues, please see the System Management Handbook found in the Mimer SQL Documentation Set.
Before you begin
To carry out an online backup, the user performing the backup must either be the creator of all the databank(s) being backed-up, or have the BACKUP privilege. When system databanks are included the BACKUP privilege is required.
You must also ensure that there is enough disk space available to store the backup files. If disk space is limited, consider using offline backup with operating system utilities.
Backup a database online
Run the following SQL statements to initiate and execute the backup.
SQL> START BACKUP; SQL> CREATE BACKUP IN 'backup-file-name' FOR DATABANK user-databank-name; . . (repeat the CREATE statement for each user databank to be backed up) . SQL> CREATE BACKUP IN 'backup-file-name' FOR DATABANK logdb; SQL> CREATE BACKUP IN 'backup-file-name' FOR DATABANK sysdb; SQL> CREATE BACKUP IN 'backup-file-name' FOR DATABANK transdb; SQL> CREATE BACKUP IN 'backup-file-name' FOR DATABANK sqldb; SQL> COMMIT BACKUP; SQL> EXIT;
To ensure databank consistency, the set of CREATE BACKUP statements must be performed within a backup transaction (i.e. START BACKUP – COMMIT BACKUP).
The CREATE BACKUP statements create the backup files and the data is written by the COMMIT BACKUP statement. The commit also clears the transaction log (LOGDB) entries for those databanks included in the transaction. Please note that including LOGDB in the backup set clears the entire transaction log.
Verify the databank files
To check the physical condition of the backup you may run the DBC databank check program to verify the backup files. For example:
dbc backup-filename report-filename sysdb-filename . . (repeat the dbc command for each backup file created above) .
Store the backup
Archive the backup files, for example by copying them to a removable device.
Note! As a database backup is the starting point for any restore operation, you must store the backup files in a safe place separate from your database. You can copy them to a different disk or preferably store them on a suitable backup medium that can be removed from your machine.
Note! Databank backup file names are subject to the same restrictions that apply to the SQL statement CREATE DATABANK – see the SQL Reference Manual found in the Mimer SQL Documentation Set (pdf).
The main advantage of online backup is that you can back-up all the databanks in your database, including the system databanks, while your Mimer SQL system is still running.
You use SQL system management statements to perform an online backup.
All backup operations are performed in the background.
The backup files are compressed and reorganized.
The Restore Data article explains the different ways to restore data.
The article Mimer SQL Online Backup gives more information on this extremely useful Mimer SQL feature.
Read more about backup, restore and databank checking in the System Management Handbook found in the Mimer SQL Documentation Set.