Hitachi

Hitachi Advanced Database Setup and Operation Guide


11.10.5 Changing the storage location of data DB area files

This subsection explains how to change the storage location of data DB area files that make up a data DB area.

Important

When one data DB area consists of multiple data DB area files, make sure that regular files and block special files are not intermixed as target files when you change the storage location of the data DB area files. Use only one of these types of files.

Organization of this subsection

(1) Changing a data DB area file from a regular file to a block special file

Prepare a block special file of the required size, and then change the data DB area file from a regular file to a block special file.

Figure 11‒41: How to change a data DB area file to a block special file

[Figure]

Procedure

  1. Terminate the HADB server normally with the adbstop command.

    For details about the adbstop command, see adbstop (Terminate the HADB Server) in the manual HADB Command Reference.

  2. Rename the data DB area file.

    Rename the data DB area file that is to be changed from a regular file to a block special file. Use the OS's mv command to rename the file. The following shows an example:

    • Command execution example

    mv /HADB/db/ADBUTBL01 /HADB/db/ADBUTBL01_TMP

    This example changes the file name from ADBUTBL01 to ADBUTBL01_TMP.

  3. Copy the renamed data DB area file to a block special file.

    Copy the data DB area file that has been renamed in step 2 to a block special file. Use the OS's dd command to copy the data DB area file. The following shows an example:

    • Command execution example

    dd if=/HADB/db/ADBUTBL01_TMP of=/dev/mapper/vol01 bs=524288

    This example copies the data DB area file (/HADB/db/ADBUTBL01_TMP), which is a regular file, to a block special file (/dev/mapper/vol01).

  4. Create a symbolic link to the block special file using the original file name.

    Create a symbolic link to the block special file to which the data DB area file was copied in step 3. In this case, you need to create the symbolic link to the block special file in the original data DB area file name that was renamed in step 2. Use the OS's ln command to create a symbolic link. The following shows an example:

    • Command execution example

    ln -s /dev/mapper/vol01 /HADB/db/ADBUTBL01

    This example creates a symbolic link to the block special file (/dev/mapper/vol01) using the original file name (/HADB/db/ADBUTBL01).

  5. Start the HADB server with the adbstart command.

    For details about the adbstart command, see adbstart (Start the HADB Server) in the manual HADB Command Reference.

  6. After checking the operation of the HADB server, delete the unneeded regular file.

    Confirm that changing the data DB area file from a regular file to a block special file has not resulted in any problems. If there are no problems, the data DB area file (regular file) that was renamed in step 2 is no longer needed. Use an OS command to delete it.

(2) Changing the storage location of a data DB area file (block special file)

Prepare a block special file of the required size, and then change the storage location of the data DB area file (to a new block special file).

Figure 11‒42: Changing the storage location of a data DB area file (block special file

[Figure]

Procedure

  1. Terminate the HADB server normally with the adbstop command.

    For details about the adbstop command, see adbstop (Terminate the HADB Server) in the manual HADB Command Reference.

  2. Copy the entity of the data DB area file to a new block special file (change the storage location).

    Copy the entity of the data DB area file (target block special file of the symbolic link) whose storage area is to be changed to a new block special file. Use the OS's dd command to copy the entity of the data DB area file. The following shows an example:

    • Command execution example

    dd if=/dev/mapper/vol01 of=/dev/mapper/vol02 bs=524288

    This example copies the entity of the data DB area file (/dev/mapper/vol01) to another block special file (/dev/mapper/vol02).

  3. Delete the symbolic link to the original block special file at the storage location before the change.

    To change the storage location of the data DB area file, delete the symbolic link to the source block special file from which data was copied in step 2. Use the OS's rm command to delete the source symbolic link file. The following shows an example:

    • Command execution example

    rm /HADB/db/ADBUTBL01

    This example deletes the source symbolic link file (/HADB/db/ADBUTBL01) to delete the symbolic link to the block special file (/dev/mapper/vol01) at the storage location before the change.

  4. Create a symbolic link to the block special file at the storage location after the change.

    To change the storage location of the data DB area file, create a symbolic link to the target block special file to which data was copied in step 2. In this case, you need to use the symbolic link file name that was deleted in step 3 to create a symbolic link to the block special file. Use the OS's ln command to create the symbolic link. The following shows an example:

    • Command execution example

    ln -s /dev/mapper/vol02 /HADB/db/ADBUTBL01

    This example creates a symbolic link to the block special file (/dev/mapper/vol02) using the name of the deleted symbolic link file (/HADB/db/ADBUTBL01).

  5. Start the HADB server with the adbstart command.

    For details about the adbstart command, see adbstart (Start the HADB Server) in the manual HADB Command Reference.

  6. Check the operation of the HADB server.

    Confirm that changing the storage location of the data DB area file (block special file) has not resulted in any problems.