Valid in: SQL, ESQL
The Create User statement defines a new user.
The Create User statement has the following format:
[EXEC SQL] CREATE USER user_name
[WITH with_item {, with_item}]
with_item = NOPRIVILEGES| PRIVILEGES = ( priv {, priv} )
| NOGROUP | GROUP = default_group
| SECURITY_AUDIT= ( audit_opt {,audit_opt})
| NOEXPIREDATE | EXPIRE_DATE = 'expire_date'
| DEFAULT_PRIVILEGES = (priv {,priv})| ALL
| NODEFAULT_PRIVILEGES
| NOPROFILE | PROFILE= profile_name
| NOPASSWORD | PASSWORD = 'user_password'
| PASSWORD = X'encrypted_role_password'
| EXTERNAL_PASSWORD
Specifies the user name to be created. Must be a valid object name.
Specifies one of the following subject privileges, which apply to the user regardless of the database to which the user is connected. If the privileges clause is omitted, the default is NOPRIVILEGES.
Allows users to create databases.
Allows the user to use tracing and debugging features.
Allows the user to perform security-related functions (such as creating and dropping users).
Allows the user to perform database backups and other database maintenance operations.
Allows the user to create and change the characteristics of database and file locations.
Allows the user to register or remove audit logs and to query audit logs.
Allows the user to change the alter user security audit and alter profile security audit privileges. Also allows the user to enable, disable, or alter security audit.
Allows the user to perform various user-related functions, such as creating or altering users, profiles, group and roles, and to grant or revoke database and installation resource controls.
Specifies the default group to which the user belongs. Must be an existing group. For details about groups, see Create Group.
Note: To specify that the user is not assigned to a group, use the NOGROUP option. If the group clause is omitted, the default is NOGROUP.
Defines security audit options:
All activity by the user is audited.
Only default security auditing is performed, as specified with the ENABLE and DISABLE SECURITY_AUDIT statements. This is the default if the SECURITY_AUDIT clause is omitted.
Auditing of the query text associated with specific user queries is performed. Security auditing of query text must be enabled as a whole, using the ENALBE and DISABLE SECURITY_AUDIT statements with the QUERY_TEXT option (for example: ENABLE SECURITY_AUDIT QUERY_TEXT).
Default: DEFAULT_EVENTS if the security_audit clause is omitted.
Specifies an optional expiration date associated with each user. Any valid date can be used. Once the expiration date is reached, the user is no longer able to log on. If the expire_date clause is omitted, the default is NOEXPIRE_DATE.
Defines the privileges initially active when connecting to Ingres. These must be a subset of those privileges granted to the user.
All the privileges held by the profile are initially active.
No privileges are initially active. Allows default privileges to be removed.
Allows a profile to be specified for a particular user. If the profile clause is omitted, the default is NOPROFILE.
Allows users to change their own password. If the oldpassword clause is missing or invalid the password is unchanged. In addition, users with the maintain_users privilege can change or remove any password.
Allows a user's password to be authenticated externally to Ingres. The password is passed to an external authentication server for authentication.
In an embedded Create User statement, specify the with clause using a host string variable (with :hostvar).
You must have the maintain_users privilege and be connected to the iidbdb database.
Additional privileges are required to perform certain operations, as summarized here:
Action |
Privilege Required |
---|---|
Set security audit attributes |
maintain_audit |
The Create User statement locks pages in the iiuser system catalog.
The following are Create User statement examples:
create user bspring with
group = publishing,
privileges = (createdb, security);
create user barney with
group = sales,
noprivileges;
create user bspring
with expire_date = '6-jun-1995'
create user bspring
with expire_date = '1 month'
create user bspring
with noexpire_date
create user bspring
with password='mypassword';
create user bspring
with privileges=(write_down, write_fixed, trace,
default_privileges = (trace);
create user bspring with profile = dbop
where dbop is an existing profile.
create user bspring
with external_password;