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:
-
Execute the adbsql command.
adbsql USER-ID ? ADBUSER01 Connects to the HADB server as ADBUSER01. PASSWORD ? XXXXXXXX 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).
-
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:
-
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.