日期:2014-05-16  浏览次数:20787 次

授予角色权限,然后角色授予给用户,但是用户连接不上

--创建角色
create role role2
identified by 888888;


--授予角色权限

grant create session ,create table ,create view to role2
with admin option;

grant select ,update ,insert,delete
on scott.emp to role2;

create user user3 identified by 123456;
grant role2 to user3;



------解决方案--------------------
按楼主的代码操作没发现楼主的错误,一切正常。
create role myrole
identified by myrole;

grant create session,create table,create view to myrole
with admin option;

grant select,update,insert,delete
on scott.emp to myrole

create user testu identified by testu;
grant myrole to testu

可以用dba角色查看创建的角色拥有的权限

SELECT * FROM ROLE_TAB_PRIVS where role='MYROLE'
SELECT * FROM ROLE_ROLE_PRIVS where role='MYROLE'
SELECT * FROM ROLE_SYS_PRIVS where role='MYROLE'
SELECT * FROM ROLE_WM_PRIVS where role='MYROLE'


------解决方案--------------------
我按照你的语句实验了一次,能连接到,建议你用命令再把role2授权给user3试一试
------解决方案--------------------
赋予 CONNETC 权限