Hitachi

Hitachi Advanced Database Setup and Operation Guide


3.10.1 Connecting to the HADB server and retrieving data

Organization of this subsection

(1) Executing the connection command

  1. Execute the adbsql command.

    As the HADB administrator (adbmanager), enter the following HADB command and press Enter:

    adbsql
  2. Enter a user ID (authorization identifier) in response to the system request.

    Here, enter ADBUSER02 and press Enter.

      USER-ID?
    ADBUSER02
  3. Enter a password in response to the system request.

    Here, specify #HelloHADB_02 and press Enter.

      PASSWORD?
    #HelloHADB_02    The entered password is not displayed.

When you specify a password and press Enter, the client program connects to the HADB server, allowing you to enter SQL statements. The following shows an example of the execution result.

■ Execution result example
COMMAND ?   +----2----+----3----+----4----+----5----+----6----+----7----+

If the above execution result is displayed, you can enter SQL statements.

(2) Retrieving all of the stored data

Enter the SQL statement (SELECT statement) to retrieve all rows of the table storing the sample data and press Enter.

Make sure that the last character you enter is a semicolon (;), or the SQL statement will not execute.

SELECT * FROM "SAMPLE";

Retrieving all rows of the table outputs the state codes, state names, ZIP codes, addresses of state capitol buildings, and area sizes of the 50 U.S. states.

A message is output when the retrieval is completed. The following shows an example of the output message.

■ Example of the output message
KFAA96404-I 50 rows were selected.

(3) Terminating the connection to the HADB server

Enter the adbsql subcommand shown below and press Enter. This terminates the adbsql command.

Make sure that the last character you enter is a semicolon (;), or the SQL statement will not execute.

#EXIT;

The adbsql command terminates and another command can now be entered. The following shows an example of the execution result.

■ Execution result example
[adbmanager@localhost ~]$

(4) Terminating the HADB server

Enter the HADB command shown below and press Enter. This stops the HADB server.

adbstop

When the adbstop command is executed, messages are output and the HADB server stops. The following shows an example of the output messages.

■ Example of the output messages
KFAA90000-I adbstop processing started.
KFAA91154-I The HADB system was terminated normally.
KFAA90001-I adbstop processing ended. (return code = 0)

This completes the trial operation of an HADB server using the hands-on environment. If you no longer need the hands-on environment, uninstall the HADB server in the hands-on environment by following the procedure in 3.11 Uninstalling the HADB server.

Important

Note that the hands-on environment that was built according to the instructions in this chapter is used specifically for gaining first-hand experience in installing and operating an HADB server. It is not an environment that can be used in actual operations. Therefore, if you execute commands or SQL statements not explained in this chapter in the hands-on environment, an error might occur and the HADB server might not operate normally.

It you want to build an environment for use in actual operations, first estimate the required values based on the explanation in Part 3. Design of this manual, and then build your environment based on the explanation in Part 4. Setup of this manual.

(5) Related items