Valid in: SQL, ESQL
The Alter User statement changes the characteristics of an existing user.
Use ADD PRIVILEGES to give the user additional privileges. Use DROP PRIVILEGES to remove privileges from the user.
Note: You cannot use either ADD PRIVILEGES or DROP PRIVILEGES if with_option is specified in the with_clause.
The Alter User statement has the following format:
[EXEC SQL] ALTER USER user_name
[ADD PRIVILEGES (priv {, priv}) |DROP PRIVILEGES (priv {, priv})]
[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
| OLDPASSWORD = 'oldpassword'
Specifies the user name. The user must be an existing Ingres user.
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. To specify that the user is not assigned to a group, use the NOGROUP option.
Default: NOGROUP if the group clause is omitted.
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).
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.
Default: NOEXPIRE_DATE if the EXPIRE_DATE clause is omitted.
Defines the privileges initially active when connecting to Ingres. These must be a subset of those privileges granted to the user.
Specifies that the session is started with no privileges active. Allows default privileges to be removed.
Allows a profile to be specified for a particular user.
Default: NOPROFILE if the profile clause is omitted.
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.
Specifies the user's old password.
In an embedded Alter User statement, specify the with clause using a host string variable (with :hostvar). The privilege type can be specified using a host string variable.
You must be connected to the iidbdb database. The maintain_users privilege is required, except for users who simply want to change their own password. You must have maintain_audit privileges to change security audit attributes.
The Alter User statement locks pages in the iiuser system catalog.
The following examples change the characteristics of an existing user:
alter user bspring with
group = engineering,
noprivileges;
alter user barney with
group = marketing,
privileges = (createdb,trace,security);
alter user bspring
with noexpiration_date
alter user with
oldpassword='myoldpassword',
password='mypassword';
alter user username
with password='theirpassword'
| nopassword
alter user bspring add privileges ( createdb )
Specify a profile for a particular user.
alter user bspring with profile = dbop
where "dbop" is an existing profile.
alter user bspring
with external_password;