alter role

Defines mutually exclusive relationships between roles; adds, drops, and changes passwords for roles; specifies the password expiration interval, the minimum password length, and the maximum number of failed logins allowed for a specified role. Also locks and unlocks roles.

Syntax

alter role role1 {add | drop} exclusive 
	{membership | activation} role2 
alter role role_name [add passwd "password" | 
	drop passwd] [lock | unlock]
alter role {role_name | "all overrides"} 
	set {passwd expiration | min passwd length | 
	max failed_logins} option_value 

Parameters

Examples

Usage

See also:
  • For more information on altering roles, see the System Administration Guide.

  • mut_excl_roles, proc_role, role_contain, role_id, role_name in Reference Manual: Building Block

  • sp_activeroles, sp_displaylogin, sp_displayroles in Reference Manual: Procedures

Standards

ANSI SQL – Compliance level: Transact-SQL extension.

Permissions

The permission checks for alter role differ based on your granular permissions settings.

SettingDescription
Enabled

With granular permissions enabled, you must have the manage roles privilege.

Disabled

With granular permissions disabled, you must be a user with sso_role.

Auditing

Values in event and extrainfo columns of sysaudits are:

InformationValues
Event

85

Audit option

roles

Command or access audited

create role, drop role, alter role, grant role, or revoke role

Information in extrainfo
  • Roles – current active roles

  • Keywords or options – NULL

  • Previous value – NULL

  • Current value – NULL

  • Other information – NULL

  • Proxy information – original login name, if set proxy is in effect

Related reference
create role
drop role
grant
revoke
set