Previous PageTop Of PageTable Of ContentsNext Page


13. Database Recovery, Backup, and Restoration

13.1 Types of Database Failures

13.2 Recovery from Database Failures

13.3 Types of Backups

13.4 Backup Modes

13.5 Manual Backups

13.6 Automatic Backups

13.7 Backup History Files

13.8 Recovery Options

13. Database Recovery, Backup, and Restoration

In every database management system, the possibility of a hardware or software failure always exists. Although we would like to think otherwise, a DBMS may fall victim to these types of failures without warning. After a failure occurs, a DBMS should have some method of recovering the information that was entered into the database. In fact, this is one of the main advantages a DBMS has over the file-based systems they replaced.

DBMaker incorporates advanced data protection features to prevent data loss and down-time due to failures. These features allow DBMaker to ensure the reliability of your database and the consistency of your data by providing recovery, backup, and restoration features.

13.1 Types of Database Failures

Database failures can generally be divided into two types: system failures and media failures. When either of these types of failure occurs, there is the possibility of data inconsistency or data loss in a database that experiences a failure. A DBMS should provide facilities for recovering from database failures and for replacing a damaged database with a backup copy of the original.

System Failures

A system failure (also known as instance failure) is a failure of the main memory of a computer system. System failures may be caused by a power failure, an application or operating system crash, a memory error, or some other reason. The end result is the unexpected termination of the database management system software.

When a system failure occurs, applications and possibly active transactions terminating abnormally. Since the exact state of a transaction in progress or a transaction that has not been completely written to disk cannot be reliably determined after a system failure, these types of transactions require recovery. The most common method of protecting against system failures is the use of a transaction log, or journal file.

Media Failures

Media failure (also known as disk failure) is a failure of the disk storage system of a computer system. Media failures are usually caused by physical trauma to the disk itself, such as a head crash, fire, or exposure to vibration or g-forces outside its physical operating limits.

When a media failure occurs, there is generally nothing that can prevent the loss of data on the affected disk. One or more files may be physically damaged as a result of the failure, requiring restoration of the database. However the database can be successfully restored if the database provides backup and restoration facilities.

13.2 Recovery from Database Failures

The goals of recovery after a database failure are to ensure committed transactions are reflected in the database, ensure uncommitted transactions are not reflected in the database, and to return to normal operation as quickly as possible while insulting users from problems caused by the failure.

DBMaker uses journal files and checkpoints to achieve these goals. The journal files and checkpoints work together to ensure that all transactions are recovered in a short a time as possible, with as little effect on users as possible.

Journal Files

Journal files provide a real-time, historical record of all changes made to a database, and the status of each change. In the event of a system failure, the historical record of changes maintained in the journal file allows DBMaker to recover from the failure and redo changes made by transactions that completed but were not written to disk, or undo changes made by transactions that terminated abnormally.

If a database is running in backup mode, the journal files will also store additional information that DBMaker can use to restore a database after a media failure. This information will remain in the journal files until they are backed up; after you back up the journal files DBMaker will free this space for use by new transactions. During the restoration process, DBMaker will add the information from the backup journal files to a backup copy of the database. This allows you to back up only the journal files which contain the changes made to the database between full backups.

Checkpoint Events

A checkpoint is a system event in which the database is brought to a clean state. DBMaker writes all journal records and all dirty data pages from its internal memory buffers to disk, and reclaims journal blocks that are no longer required for backup or recovery purposes. DBMaker can reclaim journal blocks that contain non-active transactions that completed before the start of the oldest active transaction.

Startup time after an instance failure is reduced after taking a checkpoint. DBMaker writes the time of the last checkpoint and a list of all transactions active at the time of the checkpoint to the journal file header. During database recovery, DBMaker uses this information to determine which transactions should be undone, which should be redone, and which should be ignored.

DBMaker will automatically take a checkpoint when the journal files are full to try to reclaim some journal blocks to reuse. If the checkpoint cannot reclaim enough space to complete the current transaction, the transaction will be aborted. DBMaker will also automatically take a checkpoint when the database starts and shuts down, and when you perform an online backup.

Database Administrators can initiate a checkpoint manually by executing the CHECKPOINT command. The optimal interval between two checkpoints depends on the frequency of activity in the database, the average size of transactions, and the size and number of journal files. Since these factors may vary significantly from database to database, you may only be able to determine the optimal interval through experience. Manual checkpoints reduce the amount of time required to start, terminate, and back up a database, as well as the possibility that you will encounter a full journal.

Checkpoints may require a significant amount of time to complete, depending on the size and number of transactions since the last checkpoint. Any transactions that are active when a checkpoint occurs need to wait for DBMaker to calculate which journal records it can reclaim, but do not need to wait while DBMaker actually writes journal records and dirty data pages to disk.

Recovery Steps

DBMaker provides support for automatic recovery when you try to start a database after a system failure, or when an error occurs during startup. During the recovery process, DBMaker always performs two separate steps: redo and undo.

The first step in the recovery process is to redo (or reapply) all changes made to the database that are recorded in the journal. This step is necessary since it is possible for a transaction to have completed before the system failure, without having all the changes made by the transaction written to the database. However, these changes are stored in the journal, and can be written to the database during this step. At the end of this step, the database contains the changes made by all committed transactions, as well as the changes made by all uncommitted transactions.

The second step in the recovery process is to undo (or roll back) all the changes made by transactions that were not completed before the system failure occurred. This step is necessary since the exact state of a transaction in progress cannot be reliably determined in the event of a system failure, so it cannot continue to completion. These incomplete transactions must be removed since a transaction is self-contained by definition and must either complete successfully and change the data, or fail and leave the data unchanged. At the end of this step, the database contains the changes made by all committed transactions, but does not contain any changes made by uncommitted transactions.

DBMaker also provides support for starting a database after a media failure or after a system failure that causes inconsistencies in a database that cannot be repaired during the automatic recovery process. In these cases the database will fail to start, and you would normally need to restore your database from a backup copy. However, if you have never backed up your database, you can force the database to start by setting the forced-start mode using the DB_FORCS keyword in the dmconfig.ini configuration file. This will allow you to start the database and unload the unaffected data. For more information on the forced-start mode, see "Forcing Database Startup".

13.3 Types of Backups

Backups are used to protect your database from media failures or other media errors. After a media failure, one or more of your database files may be physically damaged and unusable. You can use the most recent backup to replace the damaged files and reconstruct your database in a case like this.

There are two main types of database backups: full backups and incremental backups. In addition, there are also two different states your database may be in when you want to perform a backup: online and offline. DBMaker supports several different combinations of backup types and database states.

Full Backups

A full backup is any backup that creates a copy of all data and journal files, providing a copy of the entire database at one point in time. You can optionally create a backup copy of the dmconfig.ini configuration file as well, preserving any custom configuration settings you may have for your database. DBMaker allows you to perform a full backup while your database is online or offline.

Full backups archive the entire database, so they require a large amount of storage space. However, you can restore a database relatively quickly using a full backup since you can simply copy the backup files over the damaged originals. You can use a full backup to restore a database to the point in time you performed the full backup and copied database files.

Incremental Backups

An incremental backup is any backup that creates a copy of only the journal files that have changed since the last backup. These files provide a copy of the changes made to the database since the last backup. Since an incremental backup only contains changes made to the database, you must perform a full backup prior to the incremental database in order to restore your database at a later time. DBMaker allows you to perform an incremental backup only while your database is online.

Incremental backups archive only journal files, so they require only a small amount of storage space. However, it may take more time than a full backup to restore a database since the DBMS must take the time to roll over all transactions in the backup journal files. You can use an incremental backup together with a full backup to restore a database to any point in time between the time of the previous full backup to the time the incremental backup completed.

Offline Backups

An offline backup is any backup that must be performed after a database has been shut down. The Database Administrator must schedule a time to shut down the database, and notify all users so they can disconnect from the database. Offline backups can be inconvenient for users, since they must remember to complete all active transactions and disconnect from the database before it is shut down. DBMaker can perform only full backups while offline.

A DBMS does not need to explicitly provide the capability to back up a database offline, since you can back up the database with operating system commands after it is shut down. DBMaker allows you to perform an offline backup using this method, but also provides Server Manager, an easy-to-use graphical tool that allows you to perform offline backups without resorting to using operating system commands.

Online Backups

An online backup is any backup that can be performed while a database is running. The Database Administrator does not have to shut down the database, and users do not need to disconnect. Online backups are more convenient for users, since no action is required on their part. DBMaker can perform full and incremental backups while online.

A DBMS must explicitly provide the capability to back up a database online, since it is still running and still has users connected. DBMaker allows you to perform online backups manually using dmSQL and operating system commands, but also provides Server Manager, an easy-to-use graphical tool that allows you to perform online backups without resorting to operating system commands.

Backup Combinations

You can perform full backups and incremental backups using DBMaker, but they are mutually exclusive; you cannot perform a full backup and an incremental backup together. Similarly you can perform a backup while the database is offline or online using DBMaker, but they are also mutually exclusive; you cannot perform an offline backup and an online backup together. However, DBMaker does allow you to mix full or incremental backups with online or offline backups in certain combinations.

DBMaker supports the following backup combinations: offline full backups, online full backups, and online incremental backups. DBMaker also supports an additional backup type known as online incremental to current.

The difference between an online incremental backup and an online incremental to current backup in a database with multiple journal files is minor, but important. In an online incremental backup DBMaker will back up all journal files that have been used since the last backup, excluding the active journal file. In an online incremental to current backup DBMaker will back up all journal files that have been used, including the active journal file. This means that an online incremental backup can restore a database up to the point in time the last committed transaction was written to the last full journal file, while an online incremental to current backup can restore a database up to the point in time the active journal file was backed up.

In a database with only a single journal file, an online incremental backup and an online incremental to current backup are exactly the same. In this case the only journal file is the active journal file. DBMaker will back up this single journal file in both types of incremental backup.

13.4 Backup Modes

Backup mode determines whether DBMaker can perform online incremental backups, and the type of data that will be backed up during an incremental backup. It also determines when DBMaker will free journal blocks that belong to inactive transactions for use by other transactions. DBMaker has three backup modes: NONBACKUP, BACKUP-DATA, and BACKUP-DATA-AND-BLOB.

NONBACKUP Mode

NONBACKUP mode provides no protection for any data that was inserted or updated since the last full backup. In this mode, a database cannot perform online incremental backups. A database can use the journal to fully recover from instance failure, but a media failure may result in loss of data. Journal blocks not in use by an active transaction can be reused immediately after a checkpoint, but once they are overwritten, you can only restore the database to the point in time of the last full backup.

BACKUP-DATA Mode

BACKUP-DATA mode provides protection for data (excluding BLOB data) that was inserted or updated since the last full backup. In this mode, a database can perform an online incremental backup, but only non-BLOB data will be stored in the backup files. A database can use the journal to fully recover from instance failure, and can partially recover from media failure. Although you can use the last backup to restore the database to the point in time of the media failure, any changes to BLOB data will be lost. Journal blocks not in use by an active transaction can only be reused after a checkpoint has taken place and the journal file has been backed up.

BACKUP-DATA-AND-BLOB Mode

BACKUP-DATA-AND-BLOB mode provides protection for all data (including BLOB data) that was inserted or updated since the last full backup. In this mode, a database can perform an online incremental backup, and all data will be stored in the backup files. A database can use the journal to fully recover from instance failure, and can also fully recover from disk failure. You can use the last backup to completely restore the database to the point in time of the media failure, including all BLOB data. Journal blocks not in use by an active transaction can only be reused after a checkpoint has taken place and the journal file has been backed up.

Tablespace BLOB Backup Mode

DBMaker normally applies the backup mode setting to the entire database; this means all tablespaces in the database will be in the same backup mode. If the database is in BACKUP-DATA-AND-BLOB mode DBMaker will record all changes to data (including BLOB data) in the journal. Recording BLOB data in the journal can quickly exhaust journal space, producing frequent backups and large backup file sizes.

This may be necessary if you cannot afford to lose any BLOB data, but in many cases you may also be backing up non-critical BLOB data at the same time. Situations like this make it difficult for you to decide which backup mode you should choose. To prevent this type of situation from occurring, DBMaker allows you to modify the database backup mode for individual tablespaces when you create them.

If you want to back up BLOB data in a specific tablespace, you can use the BACKUP BLOB ON option when you execute the CREATE TABLESPACE command. If you do not want to back up BLOB data in a specific tablespace, you can use the BACKUP BLOB OFF option when you execute the CREATE TABLESPACE command. The backup mode of each tablespace will then depend on the combination of database backup mode and tablespace backup mode as follows:

If the database is running in BACKUP-DATA-AND-BLOB mode and a tablespace was created with the BACKUP BLOB ON option, DBMaker will back up BLOB data in that tablespace.

If the database is running in BACKUP-DATA-AND-BLOB mode and a tablespace was created with the BACKUP BLOB OFF option, DBMaker will not back up BLOB data in that tablespace.

If the database is running in BACKUP-DATA mode, DBMaker will not back up BLOB data regardless of whether a tablespace was created with the BACKUP BLOB ON or BACKUP BLOB OFF option.

If you do not specify either the BACKUP BLOB ON or the BACKUP BLOB OFF option when you create a tablespace, DBMaker will use BACKUP BLOB ON by default. All changes to BLOB data in that tablespace will be recorded in the journal file when the database is in BACKUP-DATA-AND-BLOB mode.

Setting the Backup Mode

DBMaker provides several different methods to set the backup mode. The method you choose depends on whether your database is online or offline, and whether you are more comfortable editing the configuration file directly, using the dmSQL command line utility, or using the Server Manager graphical utility.

Modifying the backup mode of a database to provide a higher level of backup protection (i.e. from NONBACKUP to BACKUP-DATA mode, or from BACKUP-DATA to BACKUP-DATA-AND-BLOB mode) has an effect on journal usage. The journal begins recording changes to data that was previously not recorded prior to modifying the backup mode. As a result, it is necessary to perform a full backup when you change the backup mode. This provides a starting point for the backup journal files to update during the restoration process.

No extra steps are required when modifying the backup mode of a database to provide a lower level of backup protection (i.e. from BACKUP-DATA or BACKUP-DATA-AND-BLOB mode to NONBACKUP mode) since the journal simply stops recording changes to data. DBMaker will use the previous full backup as a starting point for the backup journal files to update during the restoration process. However, some changes to data may be lost if you restore a database after changing to a lower level of backup protection.

You can change the backup mode of your database offline using the dmconfig.ini configuration file or Server Manager. Since the backup mode affects journal usage, you must perform an offline full backup before you start the database with the new backup mode setting. When changing the backup mode offline, you may change from any backup mode to any other backup mode without restriction, providing you make a full backup when going from a lower level of backup protection to a higher level. For more information on performing an offline full backup, see "Performing Offline Full Backups" later in this chapter.

You can change the backup mode of your database online using dmSQL. Since the backup mode will affect journal usage, you must change the backup mode from a lower level of backup protection to a higher level (i.e. from NONBACKUP to BACKUP-DATA or BACKUP-DATA-AND-BLOB mode, or from BACKUP-DATA to BACKUP-DATA-AND-BLOB mode) between the start and finish of a full backup period. For example:

dmSQL> begin backup;
dmSQL> set data backup on;
dmSQL> end backup datafile;
dmSQL> end backup journal;

or

dmSQL> begin backup;
dmSQL> end backup datafile;
dmSQL> set data backup on;
dmSQL> end backup journal;

DBMaker does not allow you to go from a higher level of backup protection to a lower level unless you change to NONBACKUP mode first. If you want to change from BACKUP-DATA-AND-BLOB to BACKUP-DATA mode, you must first change to NONBACKUP mode and then follow the rules above for changing from a lower level of backup protection to a higher level. You may change the backup mode from BACKUP-DATA-AND-BLOB or BACKUP-DATA to NONBACKUP at any time; you do not need to do this between the start and finish of a full backup period. For more information on performing an online full backup, see "Performing Online Full Backups" later in this chapter.

Using the dmconfig.ini Configuration File

If the database is offline, you can change the backup mode directly using the DB_BMODE keyword in the dmconfig.ini configuration file. The next time you start the database, the new backup mode will be used. If the database is online, changing the value of the DB_BMODE keyword will have no effect until the database is shut down and restarted. You must remember to perform an offline full backup if you are going from NONBACKUP to BACKUP-DATA or BACKUP-DATA-AND-BLOB mode, or from BACKUP-DATA to BACKUP-DATA-AND-BLOB mode.

To set the backup mode using the dmconfig.ini configuration file:

1. Open the dmconfig.ini configuration file on the computer on which the database server is located using any ASCII text editor.

2. Locate the database configuration section for the database for which you want to change the backup mode.

3. Change the value of the DB_BMODE keyword to one of the following values:

    0 - NONBACKUP mode
    1 - BACKUP-DATA mode
    2 - BACKUP-DATA-AND-BLOB mode

4. Restart the database to begin using the new backup mode.

If the DB_BMODE keyword is not present in the database configuration section for the database you want to change the backup mode for, you will have to add the DB_BMODE keyword to that database configuration section. You can add the keyword on a separate line anywhere between the start of the database configuration section and the start of the next configuration section; the order the keywords appear in is not important. If you do not specify a value for DB_BMODE, the default value of 0 (NONBACKUP mode) will be used.

Using dmSQL

If the database is online and you are comfortable using the dmSQL command line utility, you can change the backup mode using the SQL SET command. You must execute this command during an online full backup. The new backup mode will be enabled as soon as the command is executed.

To set the backup mode using the dmSQL command line utility:

1. Connect to the database for which you want to change the backup mode using dmSQL.

2. Begin an online full backup using the BEGIN BACKUP command.

3. Change the backup mode during the full backup period by issuing one of the following SET commands at the dmSQL command prompt:

    dmSQL> set backup off;
    dmSQL> set data backup on;
    dmSQL> set blob backup on;

4. Complete the online full backup.

The SET BACKUP OFF command corresponds to NONBACKUP mode, the SET DATA BACKUP ON corresponds to BACKUP-DATA mode, and the SET BLOB BACKUP ON command corresponds to BACKUP-DATA-AND-BLOB mode.

Using Server Manager

If the database is offline, you can change the backup mode using the Server Manager graphical utility. (Server Manager will automatically change the value of the DB_BMODE keyword in the dmconfig.ini configuration file. The next time you start the database, the new backup mode will be used. If the database is online, changing the value of the DB_BMODE keyword will have no effect until the database is shut down and restarted. You must remember to perform an offline full backup if you are going from NONBACKUP to BACKUP-DATA or BACKUP-DATA-AND-BLOB mode, or from BACKUP-DATA to BACKUP-DATA-AND-BLOB mode.

To set the backup mode offline using the Server Manager graphical utility:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to change the backup mode. The Database Options tabs appear.

4. Select the Backup tab.

5. Select the Write to Config File check box if it is not already selected. Clear the Set Run-Time Status check box if it is not already cleared.

6. Change the backup mode by performing one of the following actions:

    To enable NONBACKUP mode, select the Disable option button in the Backup Database frame.

    To enable BACKUP-DATA mode, select the Enable option button and clear the Backup BLOB Data Mode check box in the Backup Database frame.

    To enable BACKUP-DATA-AND-BLOB mode, select the Enable option button and select the Backup BLOB Data Mode check box in the Backup Database frame.

7. Click on the Close button.

If the DB_BMODE keyword is not present in the database configuration section for the database you want to change the backup mode for, Server Manager will add it automatically.

13.5 Manual Backups

You can perform offline full backups, online full backups, online incremental backups, and online incremental to current backups manually using either dmSQL or Server Manager.

Using dmSQL to perform any of these backup procedures requires knowledge of the commands or utilities your operating system uses to copy files from one location to another. Server Manager provides a faster and easier way to perform these backup procedures, since Server Manager will automatically copy the all database files to the backup directory you specify, without requiring you to perform any extra steps.

Performing Offline Full Backups

To perform an offline full backup, you must have read permission on the database files from the operating system, and write permission on the backup directory from the operating system. If you have to shut down the database first, you must have DBA or SYSADM security privileges.

You can perform an offline full backup regardless of the backup mode; the database may be running in NON-BACKUP, BACKUP-DATA, or BACKUP-DATA-AND-BLOB mode. Using an offline full backup, you can restore the database to the point in time the database was shut down.

Using dmSQL

To perform an offline full backup using dmSQL:

1. Notify all users that the database will be shut down at a specified time and ask them to disconnect from the database before that time.

2. If the database is running, shut down the database using the TERMINATE DB command. If there are any errors while you are shutting down the database, you must restart the database, correct the problem, and shut it down again.

3. Examine the dmconfig.ini configuration file and list all relevant files and directories (including the file object directory) that require backup.

4. Use operating system commands or utilities to copy the database files (including data files, journal files, file objects, and the dmconfig.ini file) to the backup directory or backup device.

Using Server Manager

To perform an offline full backup using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. If the database is running, shut down the database using Server Manager. If there are any errors while you are shutting down the database, you must restart the database, correct the problem, and shut it down again.

3. From the Database menu, choose Backup and then choose Offline Full Backup from the submenu. The Offline Full Backup dialog box appears.

4. In the Database Name drop-down list, choose the name of the database you want to back up. A list of database files that require backup appears.

5. Examine the list of files to ensure that the files listed in the Database Files and Destination Files columns are correct, and that the backup directory is correct.

6. Click OK to back up the files.

7. Examine the dmconfig.ini configuration file and determine the location of the file object directory.

8. Use operating system commands or utilities to copy all file objects to the backup directory or backup device.

Performing Online Full Backups

To perform an online full backup, you must have DBA or SYSADM security privileges. An online full backup allows you to back up all files without requiring other users to disconnect and without shutting down the database. This is feature is important for databases where continuous, uninterrupted access is required.

You can perform an online full backup regardless of the backup mode; the database may be running in NON-BACKUP, BACKUP-DATA, or BACKUP-DATA-AND-BLOB mode. Using an online full backup, you can restore the database to any time between the time the END BACKUP DATAFILE was executed to the time the active journal file was copied.

Using dmSQL

To perform an online full backup using dmSQL:

1. Examine the dmconfig.ini configuration file and list all relevant files and directories (including the file object directory) that require backup.

2. Connect to the database you want to back up.

3. Execute the BEGIN BACKUP command to begin the backup and place the database in the backup state.

4. Use operating system commands or utilities to copy all data and BLOB files to the backup directory or backup device.

5. Execute the END BACKUP DATAFILE command to inform DBMaker that all data and BLOB files have been backed up. This is the earliest point in time that the database can be restored to.

6. Use operating system commands or utilities to copy all journal files to the backup directory or backup device.

7. Execute the END BACKUP JOURNAL command to inform DBMaker that all journal files have been backed up. If the database is operating in BACKUP-DATA or BACKUP-DATA-AND-BLOB mode, DBMaker can reuse all journal blocks belonging to transactions that have completed before the oldest active transaction after the END BACKUP JOURNAL command is issued.

8. Disconnect from the database.

9. Use operating system commands or utilities to copy any file objects to the backup directory or device.

Using Server Manager

To perform an online full backup using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Database menu, choose Backup and then choose Online Full Backup from the submenu. The Online Full Backup dialog box appears.

3. In the Database Name drop-down list, choose the name of the database you want to back up. A list of database files that require backup appears.

4. Examine the list of files to ensure that the files listed in the Database Files and Destination Files columns are correct, and that the backup directory is correct.

5. Click OK to back up the files.

6. Examine the dmconfig.ini configuration file and determine the location of the file object directory.

7. Use operating system commands or utilities to copy all file objects to the backup directory or backup device.

Performing Online Incremental Backups

To perform an online incremental backup, you must have DBA or SYSADM security privileges. An online incremental backup allows you to back up only those journal files that have changed since the last backup (excluding the journal file currently in use), without requiring other users to disconnect and without shutting down the database.

You can perform an online incremental backup only if the database is running in BACKUP-DATA or BACKUP-DATA-AND-BLOB mode. Using an online incremental backup, you can restore the database to any time between the time the END BACKUP DATAFILE was executed during the previous full backup, to the time the last committed transaction was written to the last full journal file.

Using dmSQL

To perform an online incremental backup using dmSQL:

1. Connect to the database you want to back up.

2. Execute the BEGIN INCREMENTAL BACKUP command to begin the backup and place the database in the backup state.

3. Record the names of the journal files and the backup identification number for each file that is displayed by dmSQL. You should keep this list in a safe place as a permanent record. If you have previously performed an online incremental backup using dmSQL, you can append this list to the end of the previous list.

4. Use operating system commands or utilities to copy all journal files in the list to the backup directory or backup device.

5. Execute the END BACKUP JOURNAL command to inform DBMaker that all journal files have been backed up. DBMaker can reuse all journal blocks belonging to transactions that have completed before the oldest active transaction after the END BACKUP JOURNAL command is issued.

6. Disconnect from the database.

7. Examine the dmconfig.ini configuration file and determine the location of the file object directory.

8. Use operating system commands or utilities to copy any file objects that have been added or modified since the last full backup to the backup directory or device.

Using Server Manager

To perform an online incremental backup using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Database menu, choose Backup and then choose Online Incremental Backup from the submenu. The Online Incremental Backup dialog box appears.

3. In the Database Name drop-down list, choose the name of the database you want to back up. A list of journal files that require backup appears.

4. Examine the list of files to ensure that the files listed in the Journal Files and Destination Files columns are correct, and that the backup directory is correct.

5. Click OK to back up the files.

6. Examine the dmconfig.ini configuration file and determine the location of the file object directory.

7. Use operating system commands or utilities to copy any file objects that have been added or modified since the last full backup to the backup directory or device.

Performing Online Incremental to Current Backups

To perform an online incremental to current backup, you must have DBA or SYSADM security privileges. An online incremental to current backup allows you to back up all journal files that have changed since the last backup (including the journal file currently in use), without requiring other users to disconnect and without shutting down the database.

You can perform an online incremental to current backup only if the database is running in BACKUP-DATA or BACKUP-DATA-AND-BLOB mode. Using an online incremental to current backup, you can restore the database to any time between the time the END BACKUP DATAFILE was executed during the previous full backup, to the time the active journal file was copied.

Using dmSQL

To perform an online incremental backup to current using dmSQL:

1. Connect to the database you want to back up.

2. Execute the BEGIN INCREMENTAL BACKUP TO CURRENT command to begin the backup and place the database in the backup state.

3. Record the names of the journal files and the backup identification number for each file that is displayed by dmSQL.

4. Use operating system commands or utilities to copy all journal files in the list to another location.

5. Execute the END BACKUP JOURNAL command.

6. Disconnect from the database.

7. Examine the dmconfig.ini configuration file and determine the location of the file object directory.

8. Use operating system commands or utilities to copy any file objects that have been added or modified since the last full backup to the backup directory or device.

Using Server Manager

To perform an online incremental backup to current using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Database menu, choose Backup and then choose Online Incremental Backup to Current from the submenu. The Online Incremental Backup to Current dialog box appears.

3. In the Database Name drop-down list, choose the name of the database you want to back up. A list of journal files that require backup appears.

4. Examine the list of files to ensure that the files listed in the Journal Files and Destination Files columns are correct, and that the backup directory is correct.

5. Click OK to back up the files.

6. Examine the dmconfig.ini configuration file and determine the location of the file object directory.

7. Use operating system commands or utilities to copy any file objects that have been added or modified since the last full backup to the backup directory or device.

13.6 Automatic Backups

Although DBMaker provides several tools and methods for backing up a database manually, you must still remember to perform the backups on a regular basis. Depending on your memory to back up your database may not provide a reliable safeguard for your data, since even the most reliable people may forget things on occasion. To solve this problem, DBMaker provides a convenient and easy way to perform fully automated online incremental backups using Backup Server.

Backup Server runs in the background and performs online incremental backups on a regular schedule, as journal files become full, or both. This flexibility is possible because Backup Server and the database server communicate to determine when a backup should occur, the type of incremental backup to perform, and which backup options to change. Backup Server starts at the same time as the database server, and continues running until you either stop it or shut down the database server.

There are several options you can use to configure Backup Server. These options control the filename format of the backup files, the location of the backup directory, the schedule Backup Server uses to perform backups, the amount a journal file must fill before Backup Server performs a backup, and the way Backup Server saves backup files.

Setting the Backup Filename Format

The backup filename format allows you to specify the format Backup Server will use to name backup journal files. This enables you to provide meaningful names for the backup files, making them easier to identify when you are restoring a database. The backup filename format may include both text constants and format sequences (escape sequences) that represent special character strings.

You can use the format sequences to represent the year, month, or date the backup was performed on, the name of the database, or the backup identification number. You may combine format sequences and text constants in any way, provided the result is a valid filename for the operating system you are using. The format sequences have three parts: the escape character, the length value, and the format character. The valid format sequences are:

%[n]Y - The year the journal file was backed up.
%[n]M - The month the journal file was backed up.
%[n]D - The day the journal file was backed up.
%[n]B - The backup identification number.
%[n]N - The name of the database the journal file belongs to.

The escape character identifies the start of the format sequence, and is represented by the % symbol. If you want to include the % symbol as a text constant in the backup filename format, you must use two % symbols together (i.e. %%). A single digit or one of the valid format characters shown above must immediately follow the % symbol. If any other characters follow the % symbol the backup filename format is invalid, and DBMaker will return an error.

The length value is an integer value between one and nine that determines the length of the character string generated by the format sequence. If the format sequence returns a string that can be represented in fewer characters than the length value provides, it will be expanded by adding zeroes. The database name has zeroes added to the right of the name, while all other values have zeroes added to the left. If the format sequence returns a string that requires more characters than the length value provides, it will be truncated. The database name is truncated from the right, while all other values are truncated from the left. The square brackets enclosing the length value indicate the length value is optional; do not include the square brackets when entering the format sequence. If you do not provide a value for the length, Backup Server will use the full length of the character string generated by the format sequence.

The format character identifies the type of special character string the format sequence will return. The format character must be one of Y, M, D, B, or N; using any other character will result in an invalid backup filename format, and DBMaker will return an error. A valid format character that does not immediately follow either the escape character or the escape character and a single digit will be treated as a text constant.

The values for the year, month, and date are taken from the system date, and will only be correct if the system date is correct. The value for the backup identification number is the ordinal position of the backup journal file in the backup sequence. DBMaker automatically provides this number for each journal file that is backed up by Backup Server.

The backup filename format is specified by the DB_BKFRM keyword in the dmconfig.ini configuration file. If you do not specify a backup filename format, Backup Server will use the default format: %4N%4B.JNL. The total length of the filename returned by the backup filename format must not exceed 79 characters in length.

DBMaker provides several different methods to set the backup filename format. The method you choose depends on whether you are more comfortable editing the configuration file directly or using the Server Manager graphical utility.

Using dmconfig.ini

If the database is offline, you can set the backup filename format used by Backup Server directly using the DB_BKFRM keyword in the dmconfig.ini configuration file. The next time you start the database, Backup Server will apply this backup filename format to all backup journal files. If the database is online, changing the value of the DB_BKDIR keyword will have no effect until the database is shut down and restarted.

To set the backup file format using the dmconfig.ini configuration file:

1. Open the dmconfig.ini configuration file on the computer on which the database server is located using any ASCII text editor.

2. Locate the database configuration section for the database for which you want to change the backup directory.

3. Change the value of the DB_BKFRM keyword to a string containing the format you want to use for the backup filename format. The string may contain any valid format sequences and text constants, but the total length of the resulting filename must not exceed 79 characters in length.

4. Restart the database to begin using the new backup filename format.

Using Server Manager

If the database is offline or online, you can set the backup filename format used by Backup Server using the Server Manager graphical utility. (Server Manager will automatically change the value of the DB_BKFRM keyword in the dmconfig.ini configuration file.) The next time you start the database, Backup Server will apply this backup filename format to all backup journal files.

To set the backup file format using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup filename format. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Write to Config File check box if it is not already selected. Clear the Set Run-Time Status check box if it is not already cleared.

6. Enter a valid backup filename format in the Filename Format text box in the Backup Database frame.

7. Click on the Close button.

If the DB_BKFRM keyword is not present in the database configuration section for the database you want to set the backup directory for, Server Manager will add it automatically.

Setting The Backup Directory

The backup directory specifies where the Backup Server will place all backup journal files. The backup directory must be a directory that already exists; if the directory you wish to use does not exist, you must create it using operating system commands before you specify it as the backup directory. You should choose a backup directory on a different disk than the database files to prevent the loss of both the database and the backup files in the event of a media error.

The backup directory is specified by the DB_BKDIR keyword in the dmconfig.ini configuration file. The value of the DB_BKDIR keyword may contain either a full or relative path to the backup directory. If you do not specify a backup directory, the Backup Server will automatically create a default backup directory named "backup" under the database directory. (The database directory is specified by the DB_DBDIR keyword in the dmconfig.ini configuration file.) The total length of the backup directory path must not exceed 79 characters in length.

It is not a good idea to allow the Backup Server to create and use the default backup directory if you have more than one database in the same directory. In this case the backup history information from one database may overwrite or append to the backup history information from another database, rendering one or both of the backups unusable. To avoid this type of problem you can put each database in a different database directory, or explicitly specify a backup directory for each database. Placing each database in a different database directory is the preferred method, since this allows you to see exactly which files belong to which database.

DBMaker provides several different methods to set the backup directory. The method you choose depends on whether your database is online or offline, and whether you are more comfortable editing the configuration file directly or using the Server Manager graphical utility.

Using dmconfig.ini

If the database is offline, you can set the backup directory used by Backup Server directly using the DB_BKDIR keyword in the dmconfig.ini configuration file. The next time you start the database, Backup Server will use this directory as the backup directory. If the database is online, changing the value of the DB_BKDIR keyword will have no effect until the database is shut down and restarted.

To set the backup directory using the dmconfig.ini configuration file:

1. Open the dmconfig.ini configuration file on the computer on which the database server is located using any ASCII text editor.

2. Locate the database configuration section for the database for which you want to change the backup directory.

3. Change the value of the DB_BKDIR keyword to a string containing the name of an existing directory to set the backup directory.

4. Restart the database to begin using the new backup directory.

Using Server Manager

If the database is offline, you can set the backup directory used by Backup Server using the Server Manager graphical utility. (Server Manager will automatically change the value of the DB_BKDIR keyword in the dmconfig.ini configuration file.) The next time you start the database, Backup Server will use this directory as the backup directory. If the database is online, Server Manager can change the backup directory immediately or delay the change until the next time you restart the database. In either case, Server Manager will also make a copy of the backup history file in the new backup directory.

To set the backup directory while offline using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup directory. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Write to Config File check box if it is not already selected. Clear the Set Run-Time Status check box if it is not already cleared.

6. Click on the browse button to the right of the Backup Directory text box in the Backup Server frame. The Select Directory dialog box appears.

7. Select the directory you want to use as the backup directory in the Select Directory dialog.

8. Click on the Select button.

9. Click on the Close button.

To set the backup directory while online using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup directory. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Set Run-Time Status check box if it is not already selected. The Write to Config File check box may be selected or cleared. Server Manager will always write a new value for the DB_BKDIR keyword in the dmconfig.ini configuration file when the Set Run-Time Status check box is selected.

6. Click on the browse button to the right of the Backup Directory text box in the Backup Server frame. The Select Directory dialog box appears.

7. Select the directory you want to use as the backup directory in the Select Directory dialog.

8. Click on the Select button.

9. Click on the Close button.

If the DB_BKDIR keyword is not present in the database configuration section for the database you want to set the backup directory for, Server Manager will add it automatically.

Setting the Backup Schedule

The backup schedule specifies the times when Backup Server will perform an online incremental backup. The backup schedule is composed of two parts: the initial backup time and the interval time. The initial backup time determines the date and time Backup Server will perform the first backup, and the interval time determines the length of time to wait between subsequent backups.

You can combine the backup schedule with the journal trigger value to back up your database both on a regular schedule and also when journal files fill to a specified percentage. If you do not specify a backup schedule, Backup Server will not back up the database on a regular schedule. However, Backup Server will continue to back up the database as journal files fill even without a backup schedule.

The initial backup time is specified by the DB_BKTIM keyword in the dmconfig.ini configuration file. You must enter the value of the DB_BKTIM keyword as a date and time in the format YY/MM/DD HH:MM:SS. There is no default value for the initial backup time. However, if you use Server Manager to enable Backup Server, Server Manager will provide a default value for you and write this value into the dmconfig.ini configuration file.

The interval time is specified by the DB_BKITV keyword in the dmconfig.ini configuration file. You must enter the value of the DB_BKITV keyword as a time interval in the format D-HH:MM:SS. There is no default value for the interval time. However, if you use Server Manager to enable Backup Server, Server Manager will provide a default value of 1-00:00:00 for you and write this value into the dmconfig.ini configuration file.

DBMaker provides several different methods to set the backup schedule. The method you choose depends on whether your database is online or offline, and whether you are more comfortable editing the configuration file directly or using the Server Manager graphical utility.

Using dmconfig.ini

If the database is offline, you can set the backup schedule used by Backup Server directly using the DB_BKTIM and DB_BKITV keywords in the dmconfig.ini configuration file. The next time you start the database, Backup Server will use these settings for the backup schedule. If the database is online, changing the value of the DB_BKTIM and DB_BKITV keywords will have no effect until the database is shut down and restarted.

To set the backup schedule using the dmconfig.ini configuration file:

1. Open the dmconfig.ini configuration file on the computer on which the database server is located using any ASCII text editor.

2. Locate the database configuration section for the database for which you want to change the backup schedule.

3. Change the value of the DB_BKTIM keyword to a date and time. This value should be in YY/MM/DD HH:MM:SS format.

4. Change the value of the DB_BKITV keyword to a time interval. This value should be in DDDDD-HH:MM:SS format.

5. Restart the database to begin using the new backup schedule.

Using Server Manager

If the database is offline, you can set the backup schedule used by Backup Server using the Server Manager graphical utility. (Server Manager will automatically change the value of the DB_BKTIM and DB_BKITV keywords in the dmconfig.ini configuration file.) The next time you start the database, Backup Server will use these settings as the new backup schedule. If the database is online, Server Manager can change the backup schedule immediately or delay the change until the next time you restart the database.

To set the backup schedule while offline using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup directory. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Write to Config File check box if it is not already selected. Clear the Set Run-Time Status check box if it is not already cleared.

6. Click on the browse button to the right of the Interval Time text box in the Backup Server frame. The Change Backup Server Beginning Time and Interval dialog box appears.

7. Enter a value for the initial backup time in the New Beginning Time text box. This value should be in YY/MM/DD HH:MM:SS format.

8. Enter a value for the interval time in the Time Interval text box. This value should be in D-HH:MM:SS format.

9. Click on the OK button.

10. Click on the Close button.

If the DB_BKTIM and DB_BKITV keywords are not present in the database configuration section for the database you want to set the backup schedule for, Server Manager will add them automatically.

To set the backup schedule while online using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup directory. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Set Run-Time Status check box if it is not already selected. Set the Write to Config File check box if you want to use the initial backup time and interval time settings every time you start the database, or clear the Write to Config File check box if you only want to use the settings for this session.

6. Click on the browse button to the right of the Interval Time text box in the Backup Server frame. The Change Backup Server Beginning Time and Interval dialog box appears.

7. Enter a value for the initial backup time in the New Beginning Time text box. This value should be in YY/MM/DD HH:MM:SS format.

8. Enter a value for the interval time in the Time Interval text box. This value should be in D-HH:MM:SS format.

9. Click on the OK button.

10. Click on the Close button.

Setting the Journal Trigger Value

The journal trigger value specifies the percentage a journal file must fill before Backup Server will perform an online incremental backup. You can combine the journal trigger value with the backup schedule to back up your database on a regular schedule and when journal files fill to the specified percentage.

The journal trigger value is specified by the DB_BKFUL keyword in the dmconfig.ini configuration file. The value of the DB_BKFUL keyword may be an integer value in the range 50-100, or zero. Values between 50-100 represent the percentage a journal file must fill before Backup Server performs a backup. A value of zero causes Backup Server to perform a backup whenever a journal file fills completely. Setting the value to 0 is effectively the same as setting it to a value of 100, since both will cause Backup Server to perform a backup whenever a journal file fills completely (100% full). If you do not specify a value for the journal trigger value, Backup Server will use the default value of zero.

DBMaker provides several different methods to set the journal trigger value. The method you choose depends on whether your database is online or offline, and whether you are more comfortable editing the configuration file directly or using the Server Manager graphical utility.

Using dmconfig.ini

If the database is offline, you can set the journal trigger value used by Backup Server directly using the DB_BKFUL keyword in the dmconfig.ini configuration file. The next time you start the database, Backup Server will use this setting for the journal trigger value. If the database is online, changing the value of the DB_BKFUL keyword will have no effect until the database is shut down and restarted.

To set the journal trigger value using the dmconfig.ini configuration file:

1. Open the dmconfig.ini configuration file on the computer on which the database server is located using any ASCII text editor.

2. Locate the database configuration section for the database for which you want to change the journal trigger value.

3. Change the value of the DB_BKFUL keyword to an integer value between 50-100, or zero.

4. Restart the database to begin using the new journal trigger value.

Using Server Manager

If the database is offline, you can set the journal trigger value used by Backup Server using the Server Manager graphical utility. (Server Manager will automatically change the value of the DB_BKFUL keyword in the dmconfig.ini configuration file.) The next time you start the database, Backup Server will use this setting as the new journal trigger value. If the database is online, Server Manager can change the journal trigger value immediately or delay the change until the next time you restart the database.

To set the journal trigger value while offline using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup directory. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Write to Config File check box if it is not already selected. Clear the Set Run-Time Status check box if it is not already cleared.

6. Enter a value for the journal trigger value in the User-Defined Trigger Value text box. This value should be in the range 50-100.

7. Click on the Close button.

If the DB_BKFUL keyword is not present in the database configuration section for the database you want to set the journal trigger value for, Server Manager will add it automatically.

To set the journal trigger value while online using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup directory. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Set Run-Time Status check box if it is not already selected. Set the Write to Config File check box if you want to use the journal trigger value setting every time you start the database, or clear the Write to Config File check box if you only want to use the setting for this session.

8. Enter a value for the journal trigger value in the User-Defined Trigger Value text box. This value should be in the range 50-100.

6. Click on the Close button.

Setting the Compact Backup Mode

Compact backup mode specifies whether Backup Server will back up entire journal files or only full journal blocks when it performs an online incremental backup. This is possible since not every journal block contains data needed to restore a database, so Backup Server will only back up the necessary journal blocks when it performs a backup. This allows you to save storage space on your backup device, but it also means restoring a database may take more time.

The compact backup mode setting is specified by the DB_BKCMP keyword in the dmconfig.ini configuration file. The value of the DB_BKCMP keyword may be zero or one. Setting the value to one enables compact backup mode, and setting it to zero disables compact backup mode. If you do not specify a value for the compact backup mode, Backup Server will use the default value of one (enabled).

DBMaker provides several different methods to set the compact backup mode. The method you choose depends on whether your database is online or offline, and whether you are more comfortable editing the configuration file directly or using the Server Manager graphical utility.

Using dmconfig.ini

If the database is offline, you can set the compact backup mode setting used by Backup Server directly using the DB_BKCMP keyword in the dmconfig.ini configuration file. The next time you start the database, Backup Server will use this setting for the compact backup mode. If the database is online, changing the value of the DB_BKCMP keyword will have no effect until the database is shut down and restarted.

To set the journal trigger value using the dmconfig.ini configuration file:

1. Open the dmconfig.ini configuration file on the computer on which the database server is located using any ASCII text editor.

2. Locate the database configuration section for the database for which you want to change the journal trigger value.

3. Change the value of the DB_BKCMP keyword to a one to enable compact backup mode, or zero to disable compact backup mode.

4. Restart the database to begin using the new journal trigger value.

Using Server Manager

If the database is offline, you can set the compact backup mode setting used by Backup Server using the Server Manager graphical utility. (Server Manager will automatically change the value of the DB_BKCMP keyword in the dmconfig.ini configuration file.) The next time you start the database, Backup Server will use this setting as the new compact backup mode setting. If the database is online, Server Manager can change compact backup mode setting immediately or delay the change until the next time you restart the database.

To set the compact backup mode while offline using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup directory. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Write to Config File check box if it is not already selected. Clear the Set Run-Time Status check box if it is not already cleared.

6. Select the Use Compact Backup Mode check box to enable compact backup mode. Clear this check box to disable compact backup mode.

7. Click on the Close button.

If the DB_BKCMP keyword is not present in the database configuration section for the database you want to set the compact backup mode for, Server Manager will add it automatically.

To set the compact backup mode while online using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to set the backup directory. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Set Run-Time Status check box if it is not already selected. Set the Write to Config File check box if you want to use compact backup mode every time you start the database, or clear the Write to Config File check box if you only want to use it for this session.

6. Select the Use Compact Backup Mode check box to enable compact backup mode. Clear this check box to disable compact backup mode.

7. Click on the Close button.

Starting The Backup Server

DBMaker will only start Backup Server if your database is in BACKUP-DATA or BACKUP-DATA-AND-BLOB mode and the value of the DB_BKSVR keyword is set to 1 in the dmconfig.ini configuration file. Backup Server will not start if your database is in NONBACKUP mode or if the value of the DB_BKSVR keyword is set to 0.

You do not have to explicitly start Backup Server after setting the DB_BKSVR keyword, since DBMaker will automatically start Backup Server while starting the database. Backup Server is disabled by default.

Using dmconfig.ini

If the database is offline, you can enable Backup Server directly using the DB_BKSVR keyword in the dmconfig.ini configuration file. The next time you start the database, Backup Server will also start. If the database is online, changing the value of the DB_BKSVR keyword will have no effect until the database is shut down and restarted.

To start Backup Server using the dmconfig.ini configuration file:

1. Open the dmconfig.ini configuration file on the computer on which the database server is located using any ASCII text editor.

2. Locate the database configuration section for the database for which you want to enable Backup Server.

3. Ensure the backup mode of the database is either BACKUP-DATA or BACKUP-DATA-AND-BLOB mode. The database is in BACKUP-DATA mode if the value of DB_BMODE is set to 1, and it is in BACKUP-DATA-AND-BLOB mode if the value of DB_BMODE is set to 2. For more information on setting the backup mode, see the section titled "Setting the Backup Mode" earlier in this chapter.

4. Change the value of the DB_BKSVR keyword to 1 to enable Backup Server.

5. Restart the database to begin using Backup Server.

Using Server Manager

If the database is offline, you can enable Backup Server using the Server Manager graphical utility. (Server Manager will automatically change the value of the DB_BKSVR keyword in the dmconfig.ini configuration file.) The next time you start the database, Backup Server will also start. If the database is online, enabling Backup Server will have no effect until the database is shut down and restarted.

To start Backup Server while offline using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to enable Backup Server. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Write to Config File check box if it is not already selected. Clear the Set Run-Time Status check box if it is not already cleared.

6. Ensure the backup mode of the database is either BACKUP-DATA or BACKUP-DATA-AND-BLOB. The database is in BACKUP-DATA mode if the Enabled option button is selected in the Backup Database frame, and it is in BACKUP-DATA-AND-BLOB mode if both the Enabled option button and the Backup BLOB Data Mode check box are selected in the Backup Database frame. For more information on setting the backup mode, see the section titled "Setting the Backup Mode" earlier in this chapter.

7. Select the Start option button in the Backup Server frame.

8. Click on the Close button.

If the DB_BKSVR keyword is not present in the database configuration section for the database you want to enable Backup Server for, Server Manager will add it automatically.

Stopping The Backup Server

You must explicitly stop Backup Server when you no longer want it to run by setting the value of the DB_BKSVR keyword to zero. However, Backup Server will continue running until you shut down your database and restart it.

Using dmconfig.ini

If the database is offline, you can disable Backup Server directly using the DB_BKSVR keyword in the dmconfig.ini configuration file. The next time you start the database, Backup Server will not start. If the database is online, changing the value of the DB_BKSVR keyword will have no effect until the database is shut down and restarted.

To stop Backup Server using the dmconfig.ini configuration file:

1. Open the dmconfig.ini configuration file on the computer on which the database server is located using any ASCII text editor.

2. Locate the database configuration section for the database for which you want to change the backup mode.

3. Change the value of the DB_BKSVR keyword to 0 to disable the Backup Server.

4. Restart the database.

Using Server Manager

If the database is offline, you can disable Backup Server using the Server Manager graphical utility. (Server Manager will automatically change the value of the DB_BKSVR keyword in the dmconfig.ini configuration file.) The next time you start the database, Backup Server will not start. If the database is online, disabling Backup Server will have no effect until the database is shut down and restarted.

To stop Backup Server while offline using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to disable Backup Server. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Write to Config File check box if it is not already selected. Clear the Set Run-Time Status check box if it is not already cleared.

6. Select the Stop option button in the Backup Server frame.

7. Click on the Close button.

To stop Backup Server while online using Server Manager:

1. Start the Server Manager application on the computer on which the database server is located.

2. From the Option menu, choose Database. The Database Options dialog box appears.

3. In the Database Name drop-down list, choose the name of the database for which you want to disable Backup Server. The Database Options tabs appear.

4. Select the Backup/Restore tab.

5. Select the Set Run-Time Status check box if it is not already selected. Set the Write to Config File check box if you want to disable Backup Server for future sessions. Clear the Write to Config File check box if you want to disable Backup Server only for this session.

6. Select the Stop option button in the Backup Server frame.

7. Click on the Close button.

13.7 Backup History Files

Manual incremental backups require you to note which journal files were backed up, when they were backed up, and where the backup files are located. This information may be misplaced or lost if you are not careful. Automatic backups using the backup server prevent this by automatically storing this information in the backup history file.

If you perform an incremental backup manually, you should note which journal files are backed up, when they were backed up, and where they the backup files are located. If you start the backup server, it will record all this information in a text backup history file.

Locating the Backup History File

This file is created in the backup path and is named dmBackup.his. This file will automatically be used during restoration of a database.

Understanding the Backup History File

Backup history files are composed of a number of lines. Every line has the following format:

<backup_id>: journal_file_name -> archive_file_name: time: event

This denotes that a journal file named journal_file_name was copied to an archive file named archive_file_name at time because of event. The event is a text string indicating the reason for the backup. This string can be either JOURNAL-FULL or TIME-OUT. The string JOURNAL-FULL indicates an incremental backup was performed because the journal was full. The string TIME-OUT indicates an incremental backup was performed because the scheduled backup interval has elapsed.

Using the Backup History File

If the journal full situation occurs frequently, this means you should lower the backup journal full percentage or shorten the time interval. You can also find out if the backup interval is too short by checking the backup history file. If the same journal file is backed up consecutively in the backup history file, the time interval may be too short. This situation will waste disk space because each file may only contain a few changed blocks. To avoid this situation, you can enable compact backup mode or lengthen the backup time interval.

If many journal files are backed up every time, it may mean the time interval is too long. This situation is more dangerous because of the possibility of losing more data when a disk fails. Ideally, one journal file should be backed up every time an incremental backup occurs. This will save storage space and lower the risk of losing journal data.

To shorten the time of recovery from media failures, perform full backups regularly, even if you are using the backup server. In addition, this will also reduce the amount of backup storage needed.

After the backup server is running, you still can perform incremental backups manually. As stated above, you should note the backup ID, time, and location for the backup files.

13.8 Recovery Options

Restoring a database will recreate the database as it existed at the time of your most recent full backup, plus any changes that have been made in journal files that have been backed up.

Analyzing Recovery Options

What recovery operation are available?

The answer to this question is determined by whether or not your database is in BACKUP mode. If the database is operating in NONBACKUP mode, the only option for restoration after a disk failure is to restore the most recent full backup and restart the database. All work performed since the last full backup will be lost, and must be re-entered. If this is the case, there is no need to answer the following questions.

If the database is operated in BACKUP (BACKUP-DATA or BACKUP-DATA-AND-BLOB) mode, several recovery options are available for reconstructing the damaged database.

Preparing for Restoration

Before you restore your database after a disk error, you must answer the following questions:

What point in time do you want your database restored to?

If your answer is the time when the disk error occurs, backup all journal files of the damaged database if you can. These files will help DBMaker to restore the database to the most current time.

What files have you previously backed up?

Find out where the most current full backup and all subsequent incremental backups are located. For example, suppose you perform a full backup on the 30th day of every month and an incremental backup every 10 days. If your system is damaged on May 25, you need the full backup from April 30, the incremental backups from May 10 and May 20, and the damaged journal files from May 25. After locating these files, DBMaker can restore your database to the state it was in previous to the failure on May 25. Since all online backup information is stored in the backup history file, DBMaker will read it to get this information when restoring a database.

Performing a Restoration

DBMaker uses Server Manager to perform restoration. The following procedure is used to restore a database:

Server Manager copies all files of the most recent full backup (includes BLOB files, data files, journal files and dmconfig.ini) to the directory specified by the DB_DBDIR keyword in dmconfig.ini.

Set the time you want to restore the database to if you want to re-create the state the database was in at a specific point in time. If you want to restore to the most current time, you can skip this step.

Specify the location of all incremental back-up journal files. The files should be listed in order of backup ID, if any.

Journal files that were backed up after a disk error occurred can be included in the restoration process. They can also be applied after all backed up journal files have been applied. (This may not be true if the disks containing the journal files failed.)

After the restoration is complete, the database is in a consistent state and has been shut down. Users may then start the database and begin using it.

Previous PageTop Of PageTable Of ContentsNext Page

Copyright 2002 SYSCOM Computer Engineering Co. All rights reserved.