Previous Topic

Next Topic

Alter Role

Valid in: SQL, ESQL

The Alter Role statement changes the attributes associated with a role identifier.

Use add privileges to give the user additional privileges. Use drop privileges to remove privileges from the user. You cannot use either add privileges, or drop privileges if with_option is specified in the with_clause.

Previous Topic

Next Topic

Syntax

The Alter Role statement has the following format:

[EXEC SQL] ALTER ROLE role_id {, role_id}
[ADD PRIVILEGES ( priv {,priv} ) | DROP PRIVILEGES ( priv {,priv} )]
[WITH with_option {,with_option}]

with_option = NOPASSWORD | PASSWORD = 'role_password' | EXTERNAL_PASSWORD
  | NO PRIVILEGES | PRIVILEGES = ( priv {,priv} )
                       | NOSECURITY_AUDIT | SECURITY_AUDIT

Previous Topic

Next Topic

Embedded Usage

In an embedded Alter Role statement, the preprocessor does not validate the syntax of the with clause.

Previous Topic

Next Topic

Permissions

You must have maintain_users privileges and be connected to the iidbdb database. Additional privileges are required to perform certain operations, as summarized in the table below:

Action

Privilege Required

Change security audit attributes

maintain_audit

Previous Topic

Next Topic

Locking

The Alter Role statement locks pages in the iirole catalog of the iidbdb. This can cause sessions attempting to connect to the server to suspend until the statement is completed.

Previous Topic

Next Topic

Related Statements

Create Role

Drop Role

Previous Topic

Next Topic

Examples: Alter Role

The following examples change the attributes associated with a role identifier:

  1. Change the password for the role identifier, new_accounts, to eggbasket.

    alter role new_accounts with
    password = 'eggbasket';

  2. Remove the password associated with the identifier, chk_inventory.

    alter role chk_inventory with nopassword;

  3. In an application, change the password for the role identifier, mon_end_report to goodnews.

    exec sql alter role mon_end_report with
    password = goodnews;

  4. Alter a role to remove a privilege and audits all activity performed when the role is active.

    alter role sysdba
    drop privileges (trace)
    with security_audit;


© 2007 Ingres Corporation. All rights reserved.