Hitachi

Hitachi Advanced Database Setup and Operation Guide


10.2.2 Terminating the HADB server

To stop the HADB server, execute the adbstop command. This stops the HADB server.

Enter the command as follows:

adbstop#
#

By specifying an option when executing the adbstop command, you can change the HADB server termination mode. For details, see (1) HADB server termination modes and (2) Option specification and normal termination types.

Important

If there are applications or commands connected to the HADB server, executing the adbstop command will not terminate the HADB server.

Organization of this subsection

(1) HADB server termination modes

The HADB server can be terminated in any of the modes described below. The options you specify in the adbstop command differ depending on the termination mode.

Table 10‒3: HADB server termination mode

No.

Termination mode

Command and option to be executed

Explanation

1

Normal termination

adbstop

This is the normal termination mode.

There are four types of normal termination, and the termination process differs depending on the option specified. For details, see (2) Option specification and normal termination types.

2

Forced termination

adbstop --force

The HADB server terminates without waiting for any transactions currently being processed to be completed.

Once the adbstop --force command is executed, no new connection requests are accepted.

The transactions being processed will be the target of recovery processing when the HADB server is restarted.

3

Abnormal termination

--

This is the mode in which the HADB server is terminated by some error.

The HADB server terminates without waiting for any transactions being processed to be completed.

The transactions being processed will be the target of recovery processing when the HADB server is restarted.

Legend:

--: There is no command to be executed.

(2) Option specification and normal termination types

The normal termination process differs depending on the option specified for the adbstop command. The table below shows the options that can be specified for the adbstop command and the types of normal termination.

For details about how to specify options for the adbstop command, see adbstop (Terminate the HADB Server) in the manual HADB Command Reference.

Table 10‒4: Options to be specified for the adbstop command and the normal termination types

No.

Command and option to be executed

Explanation

1

adbstop

When the adbstop command (with no option specified) is executed, the HADB server terminates if no application program is connected to the HADB server or if no command is being executed.

Situation in which the adbstop command is executed

Execute this command if you want to terminate the HADB server normally when no application program is connected to the HADB server and no command is being executed.

Processing that occurs when the adbstop command is executed

When the adbstop command is executed and the HADB server termination process starts, no new connection requests are accepted.

If there is an application program that is connected to the HADB server or a command that is being executed, an error occurs and the KFAA91152-E message is output (the HADB server cannot be terminated). In such a case, see the manual HADB Messages and take the step described in the action column of the KFAA91152-E message.

2

adbstop --wait connection

When the adbstop --wait connection command is executed, the HADB server terminates after waiting for the following processes to be completed:

  • Disconnection of any connected application programs from the HADB server

  • Termination of the command being executed

When to execute the adbstop --wait connection command

Execute this command in the following situations:

  • If you want to normally terminate the HADB server as soon as the command being executed (such as the adbimport command) terminates

  • If you want to normally terminate the HADB server immediately after processing by any connected application programs finishes and the application programs are disconnected from the HADB server

Processing that occurs when the adbstop --wait connection command is executed

After the adbstop --wait connection command is executed, the HADB server enters termination standby processing and waits for the following processes (the wait time in termination standby processing can be specified using the -t option):

  • Disconnection of connected application programs from the HADB server

  • Termination of commands being executed

During this time, the HADB server accepts no new connection requests (it still accepts new transaction start requests from an application program connected to the HADB server or a command being executed).

When all application programs connected to the HADB server have been disconnected and all commands being executed terminate, the HADB server termination process starts.

3

adbstop --wait transaction

When the adbstop --wait transaction command is executed, the HADB server terminates after waiting for the transactions being processed to finish and the commands being executed to terminate.

When to execute the adbstop --wait transaction command

Execute this command in the following situations:

  • If you want to normally terminate the HADB server as soon as the transactions being processed finish

  • If you want to normally terminate the HADB server as soon as the command being executed (such as the adbimport command) terminates

  • If you want to normally terminate the HADB server when an application program is connected but no transaction has started

Processing that occurs when the adbstop --wait transaction command is executed

After the adbstop --wait transaction command is executed, the HADB server enters termination standby processing and waits for the transactions being processed to finish and the commands being executed to terminate (the wait time in termination standby processing can be specified using the -t option).

During this time, the HADB server accepts no new connection requests or new transaction start requests.

When all transactions being processed finish and all commands being executed terminate, all application programs and commands connected to the HADB server are disconnected and the HADB server termination process starts.

4

adbstop --cancel

When the adbstop --cancel command is executed, the HADB server terminates, canceling the transactions being processed and the commands being executed.

When to execute the adbstop --cancel command

Execute this command when you want to normally terminate the HADB server immediately by canceling processing.

Processing that occurs when the adbstop --cancel command is executed

After the adbstop --cancel command is executed, the HADB server cancels the transactions being processed and the commands being executed.

During this time, the HADB server accepts no new connection requests or new transaction start requests.

When all transactions being processed and all commands being executed are canceled, all application programs and commands connected to the HADB server are forcibly disconnected, and the HADB server termination process starts.

■ Termination standby processing

Termination standby processing is a status in which the HADB server is waiting for the following processes:

  • Disconnection of connected application programs from the HADB server

  • Termination of commands being executed

  • Completion of transactions being processed

The HADB server enters termination standby processing only when the adbstop --wait connection command and the adbstop --wait transaction command are executed. Termination standby processing has a wait time, which can be specified using the -t option of the adbstop command. If the -t option is omitted, the default wait time is applied.

■ Wait time in termination standby processing

A timeout occurs in any of the following cases: if an application program connected to the HADB server is not disconnected, if a command being executed does not terminate, or if a transaction being processed does not finish within the wait time in termination standby processing. When a timeout occurs, the HADB server does not terminate. In this case, eliminate the cause of the error based on the information in the KFAA91152-E message that was output.

When the wait time in termination standby processing is exceeded (a timeout occurs), the HADB server can once again accept new connection requests and new transaction start requests.

■ Checking for termination standby processing

You can use the adbls -d srv command to check whether the HADB server is in termination standby processing. If the output item STATUS shows STOPWAIT, the HADB server is in termination standby processing.

If you want to cancel termination standby processing, use the operating system's kill command to terminate the adbstop command process. This cancels termination standby processing.

When termination standby processing is canceled, the HADB server can once again accept new connection requests and new transaction start requests.

For details about the adbls -d srv command, see adbls -d srv (Display the HADB Server Status) in the manual HADB Command Reference.

(3) Checking whether the termination process has been completed

To check whether the HADB server has completed terminating, check the return code of the adbstop command.