Hitachi

Hitachi Advanced Database Setup and Operation Guide


17.3.7 Creating a database

This subsection explains how to create databases in the cold standby configuration.

Organization of this subsection

(1) General procedure for creating a database

The following shows the general procedure for creating a database:

  1. Configure a file system for the DB directory (performed in the active system).

  2. Mount the file system for the DB directory (performed in the active system).

  3. Create a database (performed in the active system).

  4. Unmount the file system for the DB directory (performed in the active system).

  5. Mount the file system for the DB directory (performed in the standby system).

  6. Unmount the file system for the DB directory (performed in the standby system).

  7. Configure a file system for storing temporary work files (performed in the active system).

  8. Mount and unmount the file system for storing temporary work files (performed in both the active and standby systems).

  9. Build a file system for storing synonym dictionary files (performed in the active system)#1.

  10. Mount and unmount the file system for storing synonym dictionary files (performed in both the active and standby systems)#1.

  11. Build the file system where the audit trail directory will be created (performed in the active system)#2.

  12. Mount and unmount the file system where the audit trail directory will be created (performed in both the active and standby systems)#2.

  13. Configure the file systems that will be shared (performed in the active system).

  14. Share the file systems (performed in both the active and standby systems).

#1

You must complete the aforementioned procedure in order to perform synonym searches.

#2

You must perform this procedure in order to use the audit trail facility.

(2) Configuring a file system for the DB directory (performed in the active system)

Perform this task as a superuser.

Configure a file system for the DB directory by executing an OS command in the active system.

The following execution example configures /dev/vg_hadb01/hadb_db, which has been created as an LV for the DB directory, in an ext4 file system.

■ Command execution example
mkfs -t ext4 /dev/vg_hadb01/hadb_db

(3) Mounting the file system for the DB directory (performed in the active system)

Perform this task as a superuser.

Mount the file system for the DB directory in the active system according to the following procedure.

Procedure:

  1. Create a mount point for the DB directory.

    Execute an OS command to create the mount point for the DB directory.

    ■ Command execution example

    mkdir -p /HADB/db
  2. Activate the VG that contains the file system for the DB directory.

    Execute an OS command to activate the VG that contains the file system for the DB directory.

    ■ Command execution example

    vgchange -a y /dev/vg_hadb01
  3. Mount the file system for the DB directory.

    Execute an OS command to mount the file system for the DB directory.

    ■ Command execution example

    mount /dev/vg_hadb01/hadb_db /HADB/db -t ext4 -o defaults,noatime,_netdev
  4. Change the owner of the DB directory.

    Execute an OS command to change the owner of the DB directory. Specify the HADB administrator (OS user) and the HADB administrators group that will be using the DB directory.

    The following example specifies adbmanager as the user name for the HADB administrator (OS user) and adbgroup as the HADB administrators group.

    ■ Command execution example

    chown adbmanager.adbgroup /HADB/db

(4) Creating a database (performed in the active system)

Perform this task as the HADB administrator.

Create a database in the active system according to the following procedure.

Procedure:

  1. Verify that the file system for the DB directory is mounted at the mount point for the DB directory.

  2. Execute the adbinit command to create a database.

    The following shows an example of specifying the initialization options in the adbinit command.

    ■ Initialization option specification example (in a single-path configuration)

    set adb_init_dbarea_initialize = Y
    set adb_init_wrk_blk_path = /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000d
    set adb_init_mst_blk_path = /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000e
    set adb_init_dic_blk_path = /dev/disk/by-id/wwn-0x60060e8010205850051104c50000000f
    set adb_init_stbl_blk_path = /dev/disk/by-id/wwn-0x60060e8010205850051104c500000010
    adbinitdbarea -n ADBUTBL01 -i 2G \
                  -v /dev/disk/by-id/wwn-0x60060e8010205850051104c500000011
    adbinitdbarea -n ADBUIDX01 -i 2G \
                  -v /dev/disk/by-id/wwn-0x60060e8010205850051104c500000013

    ■ Initialization option specification example (in a redundant configuration using multipath software (DMMP))

    set adb_init_dbarea_initialize = Y
    set adb_init_wrk_blk_path = /dev/mapper/mpath16
    set adb_init_mst_blk_path = /dev/mapper/mpath12
    set adb_init_dic_blk_path = /dev/mapper/mpath11
    set adb_init_stbl_blk_path = /dev/mapper/mpath13
    adbinitdbarea -n ADBUTBL01 -i 2G \
                  -v /dev/mapper/mpath14
    adbinitdbarea -n ADBUIDX01 -i 2G \
                  -v /dev/mapper/mpath15

(5) Unmounting the file system for the DB directory (performed in the active system)

Perform this task as a superuser.

Unmount the file system for the DB directory in the active system according to the following procedure.

Procedure:

  1. Unmount the file system for the DB directory.

    Execute an OS command to unmount the file system for the DB directory.

    ■ Command execution example

    umount /dev/vg_hadb01/hadb_db
  2. Deactivate the VG that contains the file system for the DB directory.

    Execute an OS command on the active system to deactivate the VG that contains the file system for the DB directory.

    ■ Command execution example

    vgchange -a n /dev/vg_hadb01

(6) Mounting the file system for the DB directory (performed in the standby system)

Perform this task as a superuser.

Similarly to the active system, mount the file system for the DB directory in the standby system. Create a mount point with the same path as in the active system.

For details about how to mount a file system, see (3) Mounting the file system for the DB directory (performed in the active system).

Important

In the standby system, you only create a mount point for the file system for the DB directory. You do not execute the adbinit command.

(7) Unmounting the file system for the DB directory (performed in the standby system)

Perform this task as a superuser.

Similarly to the active system, unmount the file system for the DB directory in the standby system.

For details about how to unmount a file system, see (5) Unmounting the file system for the DB directory (performed in the active system).

(8) Configuring a file system for storing temporary work files (performed in the active system)

Perform this task as a superuser.

Configure a file system for storing temporary work files by executing an OS command in the active system.

The following execution example builds /dev/vg_hadb02/hadb_workarea, which was created as the LV for storing temporary work files, as an ext4 file system.

■ Command execution example
mkfs -t ext4 /dev/vg_hadb02/hadb_workarea

(9) Mounting and unmounting the file system for storing temporary work files (performed in both the active and standby systems)

Perform this task as a superuser.

After you have mounted the file system for storing temporary work files in the active system, unmount it.

Also in the standby system, mount the file system for storing temporary work files, and then unmount it.

Create the mount points so that the paths are the same in both the active system and the standby system.

For details about how to mount a file system, see (3) Mounting the file system for the DB directory (performed in the active system). For details about how to unmount a file system, see (5) Unmounting the file system for the DB directory (performed in the active system).

(10) Building file systems for storing synonym dictionary files (performed in active systems)

To perform synonym searches, you must first follow this procedure.

The superuser must perform this procedure.

Execute OS commands in the active system, to build a file system for storing synonym dictionary files.

The following execution example builds /dev/vg_hadb03/hadb_syndict, which was created as the LV for storing synonym dictionary files, as an ext4 file system.

▪ Command execution example
mkfs -t ext4 /dev/vg_hadb03/hadb_syndict

(11) Mounting and unmounting file systems for storing synonym dictionary files (performed in both the active and standby systems)

To perform synonym searches, you must first follow this procedure.

The superuser must perform this procedure.

After mounting the file system for storing synonym dictionary files in the active system, the file system is unmounted.

Similarly, after mounting the file system for storing synonym dictionary files in the standby system, the file system is unmounted.

Create mount points so that the active and standby systems both use the same path.

For details about how to mount a file system, see (3) Mounting the file system for the DB directory (performed in the active system). For details about how to unmount a file system, see (5) Unmounting the file system for the DB directory (performed in the active system).

(12) Building the file system where the audit trail directory will be created (performed in the active system)

To use the audit trail facility, you must first follow this procedure.

Perform this task as a superuser.

Build the file system for the audit trail directory by executing an OS command in the active system.

The following execution example builds /dev/vg_hadb04/hadb_audit, which was created as the LV for outputting audit trail files, as an ext4 file system.

■ Command execution example
mkfs -t ext4 /dev/vg_hadb04/hadb_audit

(13) Mounting and unmounting the file system where the audit trail directory will be created (performed in both the active and standby systems)

To use the audit trail facility, you must first follow this procedure.

Perform this task as a superuser.

In the active system, mount and then unmount the file system where the audit trail directory will be created.

Similarly, in the standby system, mount and then unmount the file system where the audit trail directory will be created.

Create the mount points so that the paths are the same in both the active system and the standby system.

For details about how to mount a file system, see (3) Mounting the file system for the DB directory (performed in the active system). For details about how to unmount a file system, see (5) Unmounting the file system for the DB directory (performed in the active system).

(14) Configuring the file systems that will be shared (performed in the active system)

Perform this task as a superuser.

Share the following file systems between the active system and the standby system:

Configure these file systems.

(15) Sharing the file systems (performed in both the active and standby systems)

Share between the active system and the standby system the file systems configured in (14) Configuring the file systems that will be shared (performed in the active system).

An example of sharing a file system by using an NFS server is below. Perform this task as a superuser.

Procedure:

  1. Provide an NFS server and export the directories that you want to share between the active system and the standby system.

  2. Mount the directories exported in step 1 so that the paths are the same between the active system and the standby system.