The CREATE USER statement (create_user_statement) defines a user. The existence and the properties of the user are recorded in the database catalog in the form of metadata.
<create_user_statement>
::= CREATE USER <user_name> PASSWORD <password>
[<user_mode>]
[TIMEOUT <unsigned_integer>] [COSTWARNING <unsigned_integer>]
[COSTLIMIT <unsigned_integer>] [[NOT] EXCLUSIVE] [DEFAULTCODE <ASCII
| UNICODE>]
| CREATE USER <user_name> PASSWORD <password> LIKE
<source_user>
| CREATE USER <user_name> PASSWORD <password> USERGROUP
<usergroup_name>
user_name, user_mode, unsigned_integer, usergroup_name
The current user must be a database administrator (DBA user). The user is the owner of the created user.
The specified user name must not be identical to the name of an existing user, a user group, or a role.
The password (password) must be specified when an database session is started. It ensures that only authorized users can access the database system.
Unsigned integers (unsigned_integer) must always be greater than 0.
Unlimited disk space is available to the user for the storage of his or her private and temporary tables (in the context of the sizes specified for the data volumes during the installation).
The timeout value is specified in seconds and must be between 30 and 32400.
Only the database system administrator (SYSDBA user) can define users with the timeout value 0.
COSTWARNING and COSTLIMIT limit costs by preventing users from executing query statements or insert statements in the form of INSERT...SELECT... beyond a specified degree of complexity.
Before these SQL statements are executed, the costs expected to result from this statement are estimated. This SELECT costs estimate can be output with the EXPLAIN statement. In interactive mode, the estimated SELECT cost value is compared with the COSTWARNING and COSTLIMIT values specified for the user.
The COSTWARNING and COSTLIMIT values are ignored with query statements or insert statements in the form INSERT...SELECT... which are embedded in a programming language.
COSTWARNING: specifies the estimated SELECT cost value beyond which the user receives a warning. In this case, the user is asked whether he or she really wants to execute the SQL statement.
COSTLIMIT: specifies the estimated SELECT cost value beyond which the SQL statement is not executed.
The COSTLIMIT value must be greater than the COSTWARNING value.
EXCLUSIVE: prevents the user from opening two different database sessions simultaneously.
NOT EXCLUSIVE: allows the user to open several database sessions simultaneously.
If the EXCLUSIVE condition is not specified, EXCLUSIVE is assumed implicitly (without NOT).
The value of the special database parameter DEFAULT_CODE is overridden with the code attribute specified in DEFAULTCODE for the objects of the specified user.
The current user must have owner authorization over the source user (source_user).
If the source user is not a member of a user group, the new user receives the same user class and values for PERMLIMIT, TEMPLIMIT, TIMEOUT, COSTWARNING, COSTLIMIT, and EXCLUSIVE as the source user. The new user receives all the privileges that the source user was granted by other users.
If the source user is a member of a user group, a new member is created in this user group with the new user name.
The user issuing the SQL statement must be the owner of the specified user group. The new user then becomes a member of this user group.