16.3.8 Creating a database
This subsection explains the procedure for creating a database when the multi-node function is used.
- Organization of this subsection
(1) General procedure for creating a database
The following shows the general procedure for creating a database:
-
Initialize the file systems to be inherited at node switchover.
-
Create a database on the master node.
-
Create a DB directory on each slave node.
(2) Initializing the file systems subject to node switchover
Use commands provided by the operating system to initialize the file system for the system directory and the file system that stores the synonym dictionary files.
- Initializing the file system for the system directory
-
The following example initializes /dev/vg_hadb/hadb_sys, which has been created as an LV for the system directory, as an ext4 file system.
Command execution example
mkfs -t ext4 /dev/vg_hadb/hadb_sys
- Initializing the file system that stores synonym dictionary files
-
The following execution example initializes /dev/vg_hadb02/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_hadb02/hadb_syndict
If you will not conduct synonym searches, you do not need to initialize the file system that stores synonym dictionary files.
(3) Creating a database on the master node
The following explains how to create a database on the master node.
First, execute the OS mount command on the master node, and on $DBDIR/ADBSYS mount the file system used for the system directory.
Next, execute the adbinit command on the master node, and create the database. The following shows an example of specifying the initialization option of the adbinit command.
■ Initialization option specification example (master node)
-
Example for single-path configuration
set adb_init_dbarea_initialize = Y set adb_init_wrk_blk_path = /dev/mapper/WRK001 set adb_init_mst_blk_path = /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b7d9fd set adb_init_dic_blk_path = /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b828e9 set adb_init_stbl_blk_path=/dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b87793 adbinitdbarea -n ADBUTBL01 -i 2G \ -v /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b8c6d3 adbinitdbarea -n ADBUIDX01 -i 2G \ -v /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b9160f
-
Example for redundant configuration using multipath software (DMMP)
set adb_init_dbarea_initialize = Y set adb_init_wrk_blk_path = /dev/mapper/WRK001 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
Finally, after execution of the adbinit command ends, from $DBDIR/ADBSYS unmount the file system used for the system directory.
(4) Creating a DB directory on each slave node
Execute the adbinit command on each of the slave nodes. The initialization option to be specified here is different from that specified for the master node in the following ways:
-
N is specified for adb_init_dbarea_initialize to create only a framework for a DB directory.
-
Specify for adb_init_wrk_blk_path the block special file name of the work table DB area file to be allocated to each node.
■ Initialization option specification example (slave node hadb02)
-
Example for single-path configuration
# Create only a framework for the DB directory. set adb_init_dbarea_initialize = N # WRK002 : DB area disk that constitutes work table DB area for hadb02 set adb_init_wrk_blk_path = /dev/mapper/WRK002 set adb_init_mst_blk_path = /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b7d9fd set adb_init_dic_blk_path = /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b828e9 set adb_init_stbl_blk_path=/dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b87793 adbinitdbarea -n ADBUTBL01 -i 2G \ -v /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b8c6d3 adbinitdbarea -n ADBUIDX01 -i 2G \ -v /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b9160f
-
Example for redundant configuration using multipath software (DMMP)
# Create only a framework for the DB directory. set adb_init_dbarea_initialize = N # WRK002 : DB area disk that constitutes work table DB area for hadb02 set adb_init_wrk_blk_path = /dev/mapper/WRK002 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
■ Initialization option specification example (slave node hadb03)
-
Example for single-path configuration
# Create only a framework for the DB directory. set adb_init_dbarea_initialize = N # WRK003 : DB area disk that constitutes work table DB area for hadb03 set adb_init_wrk_blk_path = /dev/mapper/WRK003 set adb_init_mst_blk_path = /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b7d9fd set adb_init_dic_blk_path = /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b828e9 set adb_init_stbl_blk_path=/dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b87793 adbinitdbarea -n ADBUTBL01 -i 2G \ -v /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b8c6d3 adbinitdbarea -n ADBUIDX01 -i 2G \ -v /dev/disk/by-id/wwn-0x600605b0041db9c016ea34c3b1b9160f
-
Example for redundant configuration using multipath software (DMMP)
# Create only a framework for the DB directory. set adb_init_dbarea_initialize = N # WRK003 : DB area disk that constitutes work table DB area for hadb03 set adb_init_wrk_blk_path = /dev/mapper/WRK003 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