HPlogo ALLBASE/SQL Database Administration Guide: HP 3000 MPE/iX Computer Systems > Chapter 6 Backup and Recovery

Backup and Recovery Procedures for Nonarchive Logging

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Index

This section describes the steps you should follow if you will be using nonarchive logging in full production after loading your tables. The following are described separately:

  • Nonarchive backup procedures

  • Adding files to a nonarchive log

  • Nonarchive full recovery procedures

  • Nonarchive partial recovery procedures

Nonarchive Backup Procedures

If you are using nonarchive logging, you should make either a full or partial static backup of the DBEnvironment at frequent intervals.

The exact frequency depends on how much the database changes between backups. If there is very little change, then the need for backup is not as great.

Use the SQLUtil STORE or STORE PARTIAL command to make a backup copy of all or a subset of the database files in a DBEnvironment.

The STORE command starts the DBEnvironment for you, thus rolling back any incomplete transactions. Follow these steps to make a backup copy of the DBEnvironment using SQLUtil STORE:

  1. Stop the DBEnvironment and then exit ISQL.

  2. From the group containing the DBEConFile and the SYSTEM DBEFileSet use the SQLUtil STORE or STORE PARTIAL command to make a copy of the DBEnvironment or a subset, including the DBECon file. You can use the SQLUtil STORE or STORE PARTIAL command only when the DBEnvironment is stopped.

  3. Start the DBEnvironment for production only after the STORE or STORE PARTIAL is complete.

When you use nonarchive logging, you do not back up log files since you can not use nonarchive log files for rollforward recovery.

CAUTION: If you must use the MPE/iX STORE command to make a backup copy of the DBEnvironment, you should first START the DBEnvironment in single-user mode to roll back any incomplete transactions. Otherwise you risk making an inconsistent copy of the DBEnvironment. If you use MPE/iX STORE, you should also back up the DBECon file.

Adding Files to the Nonarchive Log

In nonarchive mode, your log files should be large enough to hold log records for the largest possible transaction as carried out by the maximum number of concurrent users. A formula for calculating the required size is given in the "Physical Design" chapter. If you develop a need for a larger log, you can use the SQLUtil ADDLOG command to provide another file. Then, when a transaction fills up the first file, ALLBASE/SQL will switch to the second one automatically.

If the need for more file space is temporary, use the ADDLOG command to add a new file, then use the PURGELOG command to remove it when it is no longer needed.

Nonarchive Full Recovery Procedures

In the event of a soft crash, simply start up the DBEnvironment again using a START DBE statement or a CONNECT (if AutoStart is enabled). Rollback recovery is automatic. If a transaction was not complete at the time of the crash, you must reenter it.

In the event of a hard crash (media failure), if you need to restore the entire DBEnvironment from your backup. Here is the procedure to use once the drive is replaced:

  1. Make sure you are in the group and account the DBEnvironment DBEConFile and SYSTEM DBEFileSet were in at the time of the crash.

  2. Purge any DBEnvironment files that remain.

  3. Use the SQLUtil RESTORE command to restore the DBECon file and the DBEnvironment files.

  4. Issue a START DBE NEWLOG statement to create a new log file. Specify SINGLE or DUAL logging, as before.

  5. Use the SQLUtil PURGELOG command to purge any old log files that existed prior to issuing the START DBE NEWLOG statement. (Be careful not to purge your new log files.)

  6. Use the ADDLOG command to create additional log files for the log.

  7. Manually reapply the transactions that you had entered since the backup was taken.

  8. If appropriate, use the SQLUtil STORE command to back up the DBEnvironment. (See "Nonarchive Backup Procedures," above.)

Nonarchive Partial Recovery Procedures

In the event of a hard crash of a disk that does not contain either the SYSTEM DBEFileSet and the DBEConFile, or your single log file used for single mode logging, you can use the SQLUtil RESTORE PARTIAL command to do a partial recovery of the DBEnvironment. You can recover just those DBEFiles that were damaged by the crash. Here is the procedure to use once the damaged drive is replaced:

  1. Make sure you are in the group and account from which you made the backup (usually the one containing the DBEConFile and the SYSTEM DBEFileSet).

  2. Use the SQLUtil STOREINFO command to verify the fully qualified filename (including group and account) of the DBEFiles you are going to restore (you must use the fully qualified filename, just as shown by the STOREINFO command).

  3. Use the SQLUtil RESTORE PARTIAL command to restore the DBEFileSets or DBEFiles that were damaged. The RESTORE PARTIAL may from a full backup or a partial backup, as appropriate. (As the logfiles must have been intact as a condition for doing a RESTORE PARTIAL, you should not need to create or add more log files.)

    CAUTION: All files that will be used by the transactions to be reapplied must be restored to their state as of the last backup whether they were damaged or not. This is because all files must be synchronized to the same starting point for the reapplication of transactions to result in a consistent DBEnvironment. This is true even for transactions which only read data because the data must be in the same state it was in when the transactions were originally applied.
  4. Manually reapply all transactions that were entered since the last backup against the tables lost in the crash (no transactions need to be entered against the tables that were contained in undamaged files).

  5. If appropriate, use the SQLUtil STORE or STORE PARTIAL command to make a full or partial backup of the DBEnvironment before you resume operations.

Feedback to webmaster