25.7.2 Shell script for starting HiRDB

Create a shell script for starting HiRDB (execute $PDDIR/bin/pdstart). Be sure to execute that shell script when you start the package (during package startup preprocessing). Set up the shell script for starting HiRDB so that the package control script for MC/ServiceGuard executes this shell script. Figure 25-46 shows the flow of HiRDB startup processing.

Figure 25-46 HiRDB startup processing flow (MC/ServiceGuard)

[Figure]

Organization of this subsection
(1) Examples of a shell script for starting HiRDB
(2) When the pdstart command fails and HiRDB cannot be started
(3) Note

(1) Examples of a shell script for starting HiRDB

Examples of a shell script for starting HiRDB are shown below.

HiRDB/Single Server

#!/bin/sh
PDDIR=/HiRDB_S
PDCONFPATH=${PDDIR}/conf
SHLIB_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH SHLIB_PATH PATH
${PDDIR}/bin/pdstart>/dev/null 2>&1

HiRDB/Parallel Server

#!/bin/sh
PDDIR=/HiRDB_P
PDCONFPATH=${PDDIR}/conf
SHLIB_PATH=${PDDIR}/lib
PATH=${PATH}:${PDDIR}/bin
export PDDIR PDCONFPATH SHLIB_PATH PATH
${PDDIR}/bin/pdstart -q>/dev/null 2>&1

Note
Modify the PDDIR directory on the second line as appropriate for the environment.
The pdstart -q command starts the units in a HiRDB/Parallel Server when the system switchover facility is used.

(2) When the pdstart command fails and HiRDB cannot be started

The following are possible causes of a pdstart command failure:

  1. HiRDB is being started
  2. HiRDB is running
  3. HiRDB is being terminated normally or planned termination is underway
  4. HiRDB is terminating abnormally
  5. HiRDB's environment setup is incorrect

Items 1-4 can occur if the package is started before HiRDB has stopped. There is no means to accurately determine this timing. In such a case, the pdstart command error may be ignored, because it does not affect any other operations.

In the case of item 5, HiRDB cannot be started because the HiRDB environment setup is incorrect; correct the environment setup.

(3) Note

If no system RDAREAs have been created, an instruction to create system RDAREAs (execute the pdinit command) will be displayed during HiRDB startup (during execution of the pdstart command). The pdstart command started from MC/ServiceGuard is executed in the background, so it cannot respond to this instruction. Therefore, before starting operation of MC/ServiceGuard, execute the pdstart command and ensure that system RDAREAs have been created.