求高人详细解释下set role all的含义

解决方案 »

  1.   

    set role 是设置当前用户要生效的角色 
    (注:角色的生效是一个什么概念呢?假设用户a有b1,b2,b3三个角色,那么如果b1未生效,则b1所包含的权限对于a来讲是不拥有的,只有角色生效了,角色内的权限才作用于用户,最大可生效角色数由参数MAX_ENABLED_ROLES设定;在用户登录后,oracle将所有直接赋给用户的权限和用户默认角色中的权限赋给用户。) 
    sql>set role role1;//使role1生效 
    sql>set role role,role2;//使role1,role2生效 
    sql>set role role1 identified by password1;//使用带有口令的role1生效 
    sql>set role all;//使用该用户的所有角色生效 
    sql>set role none;//设置所有角色失效 
    sql>set role all except role1;//除role1外的该用户的所有其它角色生效。 
    sql>select * from SESSION_ROLES;//查看当前用户的生效的角色。 
      

  2.   

    Use the SET ROLE statement to enable and disable roles for your current sessionTo enable all roles granted to you for the current session, issue the following statement:SET ROLE ALL; 就是设置权限的。
    详细请参考:
    http://www.stanford.edu/dept/itss/docs/oracle/10g/server.101/b10759/statements_10004.htm