Hitachi

Hitachi Advanced Database Setup and Operation Guide


9.4.1 Creating an HADB user

Use a definition SQL statement to create an HADB user, and grant this user both the CONNECT privilege and the schema definition privilege.

Example:

This example creates HADB user ADBUSER02 to define base tables, and grants both the CONNECT privilege and schema definition privilege to ADBUSER02.

Procedure:

  1. Execute the adbsql command.

    adbsql
      USER-ID ?
    ADBUSER01      [Figure] Connects to the HADB server as ADBUSER01. 
      PASSWORD ?
    XXXXXXXX       [Figure] The entered password is not displayed.

    Specify the authorization identifier and password for the HADB user you created when executing the adbinit command in 9.2 Initializing a database (creating data DB areas).

  2. Execute the CREATE USER statement to create an HADB user.

    CREATE USER "ADBUSER02" IDENTIFIED BY '#HelloHADB_02'

    Executing the above SQL statement creates an HADB user who has ADBUSER02 as an authorization identifier and #HelloHADB_02 as a password.

    For details about the specification rules for authorization identifiers and passwords, see the following subsections:

  3. Execute the GRANT statement to grant the CONNECT privilege and the schema definition privilege.

    GRANT CONNECT,SCHEMA TO "ADBUSER02"

    Executing the above SQL statement grants both the CONNECT privilege and the schema definition privilege to authorization identifier ADBUSER02.

You have now finished creating HADB user ADBUSER02, who can define base tables.

Note

When using the adbsql command to execute an SQL statement, make sure that a semicolon (;) is the last character you enter.