Hitachi

Hitachi Advanced Database Command Reference


20.3.1 Creating DB area files using block special files

The example explained in this section creates a DB area by executing the adbinit command. The command allocates block special files as data DB area files and work table DB area files, as shown in the following:

[Figure]

Explanation:
  • The DB directory is /HADB/db.

  • A block special file (/dev/mapper/VolG00) is allocated as a work table DB area file.

  • Block special files (/dev/mapper/VolG01 and /dev/mapper/VolG02) are allocated as data DB area files for data DB area 1.

    The following defines the DB area to be created:

    DB area name: DBAREA01

    Page size of DB area: 4 kilobytes

    Number of DB area files: 2

    Initial allocation size for each DB area file: 500 megabytes

  • Block special files (/dev/mapper/VolG03 through /dev/mapper/VolG05) are allocated as data DB area files for data DB area 2.

    The following defines the DB area to be created:

    DB area name: DBAREA02

    Page size of DB area: 4 kilobytes

    Number of DB area files: 3

    Initial allocation size for each DB area file: 1 gigabyte

This example assumes the existence of a symbolic link destination directory and block special files and that the required access permissions have been granted.

The example uses the following procedure to execute the adbinit command.

Procedure
  1. Create an initialization option file.

  2. Execute the adbinit command.

Using an example, the following subsections explain each of these steps.

Organization of this subsection

(1) Creating an initialization option file

This example creates an initialization option file and specifies initialization options.

Example of an initialization option file
set adb_init_wrk_page_size = 32                                     ...1
set adb_init_wrk_blk_path = /dev/mapper/VolG00                      ...2
 
adbinitdbarea -n DBAREA01 \                                         ...3
              -p 4 \
              -v /dev/mapper/VolG01,/dev/mapper/VolG02 \
              -q \
              -i 500M,2
 
adbinitdbarea -n DBAREA02 \                                         ...4
              -p 4 \
              -v /dev/mapper/VolG03,/dev/mapper/VolG04,/dev/mapper/VolG05 \
              -q \
              -i 1G,3
Explanation:
  1. Specifies the page size for the work table DB area.

  2. Specifies the block special file (/dev/mapper/VolG00) that is to be allocated as a work table DB area file.

  3. Specifies the definition of data DB area 1.

    -n: Specifies the data DB area name (DBAREA01).

    -p: Specifies the page size (4 kilobytes) of the data DB area.

    -v: Specifies the block special files (/dev/mapper/VolG01 and /dev/mapper/VolG02) that are to be allocated as data DB area files.

    -q: Specifies that the data DB area files are to be created in quick mode.

    -i: Specifies the initial allocation size (500 megabytes) of each data DB area file and the number of files (2) to be created.

  4. Specifies the definition of data DB area 2.

    -n: Specifies the data DB area name (DBAREA02).

    -p: Specifies the page size (4 kilobytes) of the data DB area.

    -v: Specifies the block special files (/dev/mapper/VolG03 through /dev/mapper/VolG05) that are to be allocated as data DB area files.

    -q: Specifies that the data DB area files are to be created in quick mode.

    -i: Specifies the initial allocation size (1 gigabyte) of each data DB area file and the number of files (3) to be created.

(2) Executing the adbinit command

adbinit -u ADBUSER01                                  ...1
        -p '#HelloHADB_01'                            ...2
        /HADB/server/conf/adbinit.opt                 ...3
        /HADB/db                                      ...4
Explanation:
  1. Specifies the authorization identifier of the first HADB user that is to be created during initialization.

  2. Specifies a password for the authorization identifier specified in the -u option.

  3. Specifies the name of the initialization option file created in (1) Creating an initialization option file.

  4. Specifies the DB directory name.