Hitachi

Hitachi Advanced Database Setup and Operation Guide


17.6.3 Backup operation example (using OS commands)

This subsection provides an example of a backup operation using OS commands (an operation example for acquiring a full backup).

Organization of this subsection

(1) System configuration examples

This example assumes the cold standby configuration shown in Figure 17‒1: Example of a system configuration using the cold standby configuration with hadb01 as the active system. The DB directory, the archive directory, the directory for storing synonym dictionary files, and the audit trail directory have the following directory structures:

■ Directory structure of hadb01

■ Directory structure of hadb02

(2) Making a backup

The following shows the procedure for using OS commands to back up a database.

Procedure:

  1. Terminate the cold standby configuration normally.#1

    For details, see 17.4.2 How to terminate the cold standby configuration.

  2. Use OS commands to make a backup.

    Back up the DB directory and archive directory by executing the OS's cp and dd commands on hadb01 (active system).

    • Backing up the DB directory

      cp -r /HADB/db /HADB_bkup/db/dbdir
      dd if=/HADB/db/ADBMST of=/HADB_bkup/db/ADBMST bs=524288
      dd if=/HADB/db/ADBDIC of=/HADB_bkup/db/ADBDIC bs=524288
      dd if=/HADB/db/ADBSTBL of=/HADB_bkup/db/ADBSTBL bs=524288
      dd if=/HADB/db/ADBUTBL01 of=/HADB_bkup/db/ADBUTBL01 bs=524288
      dd if=/HADB/db/ADBUIDX01 of=/HADB_bkup/db/ADBUIDX01 bs=524288

      The backup data is stored in the /HADB_bkup/db directory.

      Ensure that the paths of the DB area files (symbolic links) in the backup of the DB directory differ from the paths of the backup DB area files that will be acquired later.

      If the DB directory is not mounted in $DBDIR, mount it by executing the operating system's mount command.

      When data in a block special file is backed up, the size of the backup will be larger than the actual size of the data being used because the entire volume is copied.

    • Backing up the archive directory

      cp -r /HADB/archive /HADB_bkup/archive

      If an archivable multi-chunk table is defined, you need to back up the archive directory.

      If the archive directory was created on an NFS server, you do not need to back up the archive directory on hadb02 (standby system).

    • Backing up the directory for storing synonym dictionary files

      cp -r /mnt/syndict /HADB_bkup/syndict

      If you are performing synonym searches, you need to back up the directory for storing synonym dictionary files.

    Note

    Because the audit trail files in the audit trail directory are regularly moved to the audit trail storage directory, you do not need to back up the audit trail directory.

  3. Start the cold standby configuration.#2

    For details, see 17.4.1 How to start the cold standby configuration.

#1

Instead of step 1, you can perform the following process:

On hadb01 (active system), execute the adbchgsrvmode command to change the HADB server operation mode in the active system to quiescence mode.

adbchgsrvmode --quiescence
#2

If you have used the method described in footnote 1 of step 1, execute the adbchgsrvmode command on hadb01 (active system) to change the HADB server operation mode in the active system to normal mode.

adbchgsrvmode --normal

(3) Recovering the database from a backup

The following shows the procedure for recovering the database from a backup.

Procedure:

  1. Terminate the cold standby configuration normally.

    For details, see 17.4.2 How to terminate the cold standby configuration.

  2. Use OS commands to recover the database

    On hadb01 (active system), execute the OS's cp and dd commands to recover the database from its backup.

    • Recovering the DB directory

    cp -r /HADB_bkup/db/dbdir/* /HADB/db
    dd if=/HADB_bkup/db/ADBMST of=/HADB/db/ADBMST bs=524288
    dd if=/HADB_bkup/db/ADBDIC of=/HADB/db/ADBDIC bs=524288
    dd if=/HADB_bkup/db/ADBSTBL of=/HADB/db/ADBSTBL bs=524288
    dd if=/HADB_bkup/db/ADBUTBL01 of=/HADB/db/ADBUTBL01 bs=524288
    dd if=/HADB_bkup/db/ADBUIDX01 of=/HADB/db/ADBUIDX01 bs=524288

    The backup file is stored in the directory /HADB_bkup/db.

    If the DB directory is not mounted in $DBDIR, mount it by executing the operating system's mount command.

    • Recovering the archive directory

    rm -r /HADB/archive/*
    cp -r /HADB_bkup/archive/* /HADB/archive

    If an archivable multi-chunk table is defined, you need to recover the archive directory.

    If the archive directory was created on an NFS server, you do not need to recover the archive directory on hadb02 (standby system).

    • Recovering the directory for storing synonym dictionary files

    rm -r /mnt/syndict/*
    cp -r /HADB_bkup/syndict/* /mnt/syndict

    If you are performing synonym searches, you need to recover the directory for storing synonym dictionary files.

  3. Start the cold standby configuration.

    For details, see 17.4.1 How to start the cold standby configuration.

    If the HADB server operation mode in the active system is in quiescence mode after the cold standby configuration has started, execute the adbchgsrvmode command on hadb01 (active system) to change the HADB server operation mode to normal mode.

    adbchgsrvmode --normal