Hitachi

Hitachi Advanced Database Setup and Operation Guide


3.5.1 Setting environment variables

The environment variables that are necessary for operating the HADB server are set in the .bashrc file. This file is stored in the following location:

This subsection explains how to use the vi command to set environment variables in the .bashrc file.

Note

You can also edit the .bashrc file using other text editors.

Organization of this subsection

(1) Setting environment variables in the .bashrc file

  1. Open the .bashrc file.

    As the HADB administrator (adbmanager), enter the operating system command below and press Enter. When you execute the vi command, the .bashrc file is opened in edit mode.

    vi /home/adbmanager/.bashrc
  2. Set environment variables.

    Press the I key to shift to insert mode. Once you are in insert mode, use the cursor keys to move the cursor to the location where environment variables go and enter the following environment variables:

    export ADBDIR=/home/adbmanager/server
    export ADBCLTDIR=$ADBDIR
    export LD_LIBRARY_PATH=$ADBDIR/lib:$ADBDIR/client/lib
    export PATH=$PATH:$ADBDIR/bin:$ADBDIR/client/bin
    export ADBLANG=UTF8
    export ADBCLTLANG=UTF8

    The following table shows the details of the environment variables that you are entering.

    Table 3‒5: List of environment variables to be specified

    No.

    Environment variable

    Value to be specified

    Description

    1

    ADBDIR

    /home/adbmanager/server

    Specifies the absolute path to the server directory.

    2

    ADBCLTDIR

    $ADBDIR

    Specifies the same path as ADBDIR in order to execute applications on the HADB server. Specify the value shown here.

    3

    LD_LIBRARY_PATH

    • $ADBDIR/lib

    • $ADBDIR/client/lib

    • Specifies the lib directory ($ADBDIR/lib) under the server directory.

    • To execute applications on the HADB server, specify the client/lib directory ($ADBDIR/client/lib) under the server directory.

    4

    PATH

    • $PATH

    • $ADBDIR/bin

    • $ADBDIR/client/bin

    • To retain the path setting valid for the OS, specify $PATH.

    • Specify the bin directory ($ADBDIR/bin) under the server directory.

    • To execute applications on the HADB server, specify the client/bin directory ($ADBDIR/client/bin).

    5

    ADBLANG

    UTF8

    Specifies the character encoding to be used.

    6

    ADBCLTLANG

    UTF8

  3. Finish setting the environment variables.

    After entering the required environment variables in insert mode, press Esc to shift to command mode. Once you are in command mode, enter the following command and press Enter:

    :wq

    The content that was specified in edit mode is saved. The environment variables have now been set in the .bashrc file.

  4. Enable the environment variables that have been set.

    Enter the following operating system command and press Enter:

    source /home/adbmanager/.bashrc

    Executing the source command enables the environment variables that were set in the .bashrc file.

(2) Verifying the environment variables that were set in the .bashrc file

To verify that the environment variables have been correctly set, enter the following operating system command and press Enter:

env

Executing the env command displays a list of the environment variables that are valid for the OS. Because the list of environment variables to be displayed is extremely long, the following shows only an excerpt as an example of the execution results.

■ Execution result example
         :
LD_LIBRARY_PATH=/home/adbmanager/server/lib:/home/adbmanager/server/client/lib
ADBCLTDIR=/home/adbmanager/server
PATH=/usr/lib64/qt-3.3/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/home/adbmanager/bin:/home/adbmanager/server/bin:/home/adbmanager/server/client/bin
ADBLANG=UTF8
ADBDIR=/home/adbmanager/server
ADBCLTLANG=UTF8
         :

(3) Related item

8.4 Setting environment variables