ITPub博客

首页 > Linux操作系统 > Linux操作系统 > SET ROLE

SET ROLE

原创 Linux操作系统 作者:perfychi 时间:2013-04-06 19:53:20 0 删除 编辑

SET ROLE

Purpose

Use the SET ROLE statement to enable and disable roles for your current session. You cannot enable more than 148 user-defined roles at one time.

When a user logs on, Oracle Database enables all privileges granted explicitly to the user and all privileges in the user's default roles. During the session, the user or an application can use the SET ROLE statement any number of times to change the roles currently enabled for the session.

You can see which roles are currently enabled by examining the SESSION_ROLES data dictionary view.

See Also:

·         CREATE ROLE for information on creating roles

·         ALTER USER for information on changing a user's default roles

·         Oracle Database Reference for information on the SESSION_ROLES session parameter

Prerequisites

You must already have been granted the roles that you name in the SET ROLE statement.

Syntax

set_role::=

De.ion of set_role.gif follows
Description of the illustration set_role.gif


Semantics

role

Specify a role to be enabled for the current session. Any roles not listed and not already enabled are disabled for the current session.

In the IDENTIFIED BY password clause, specify the password for a role. If the role has a password, then you must specify the password to enable the role.

Restriction on Setting Roles You cannot specify a role unless it was granted to you either directly or through other roles. You cannot specify a role identified globally. Global roles are enabled by default at login, and cannot be reenabled later.

ALL Clause

Specify ALL to enable all roles granted to you for the current session except those optionally listed in the EXCEPT clause.

Roles listed in the EXCEPT clause must be roles granted directly to you. They cannot be roles granted to you through other roles.

If you list a role in the EXCEPT clause that has been granted to you both directly and through another role, then the role remains enabled by virtue of the role to which it has been granted.

Restriction on the ALL Clause You cannot use this clause to enable roles with passwords that have been granted directly to you.

NONE

Specify NONE to disable all roles for the current session, including the DEFAULT role.

Examples

Setting Roles: Examples To enable the role dw_manager identified by the password warehouse for your current session, issue the following statement:

SET ROLE dw_manager IDENTIFIED BY warehouse;

 

To enable all roles granted to you for the current session, issue the following statement:

SET ROLE ALL;

 

To enable all roles granted to you except dw_manager, issue the following statement:

SET ROLE ALL EXCEPT dw_manager;

 

To disable all roles granted to you for the current session, issue the following statement:

SET ROLE NONE;

 

800x600 Normal 0 7.8 磅 0 2 false false false EN-US ZH-CN X-NONE

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/27042095/viewspace-757849/ ,如需转载,请注明出处,否则将追究法律责任。

上一篇: SET ROLE
下一篇: Oracle log_checkpoint_interval和
请登录后发表评论 登录
全部评论

注册时间:2012-06-06

最新文章