Welcome 微信登录

首页 / 数据库 / MySQL / 如何理解Oracle中“通过角色授权”需要用户重新登陆

我们经常听到在Oracle中,通过角色授予用户权限的时候需要用户重新登陆才能获得授予的权限,这句话到底怎么理解呢?通过下面的步骤我们来理解这句话的含义.1,DBA做如下的操作:create user u1 identified by u1create role r1;grant create session to r1;grant r1 to u1;
通过查询 select * from dba_sys_privs where grantee="R1",发现权限已经付给了角色.通过查询 select * from dba_role_privs where grantee="U1",发现角色r1已经付给了用户u1.
2,通过u1登录,能够正常登录,www.linuxidc.com查看相应的权限和角色也已经有了.
SQL> show user;
USER is "U1"
SQL> select * from session_privs;

PRIVILEGE
----------------------------------------
CREATE SESSION

SQL> select * from session_roles;

ROLE
------------------------------
R13,u1尝试建表:没有建表的权限.SQL> create table t(i int);
create table t(i int)
*
ERROR at line 1:
ORA-01031: insufficient privileges4,DBA建立另外一个角色r2,授予r2建表的权限,建r2授予u1.create role r2;
grant create table to r2;
grant r2 to u1;通过查询 select * from dba_role_privs where grantee="U1",发现角色r2已经付给了用户u1.
  • 1
  • 2
  • 3
  • 下一页
PostgreSQL 数据库导入导出操作RAC connection management整理相关资讯      Oracle高级培训 
  • delete表的数据后恢复  (08/30/2012 08:59:58)
  • 使用ASH信息,发现高CPUsession  (08/14/2012 07:21:32)
  • 如何阅读Oracle Errorstack Output  (08/14/2012 07:15:47)
  • Oracle Apps Patching:adpatch(  (08/16/2012 15:41:37)
  • 话说V$SQL_MONITOR  (08/14/2012 07:19:54)
  • Oracle Apps DBA工具:ADADMIN使用  (08/14/2012 07:00:09)
本文评论 查看全部评论 (0)
表情: 姓名: 字数