按楼主的代码操作没发现楼主的错误,一切正常。 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 myrolecreate 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'
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 myrolecreate 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'
我试了很多次,查看role的权限也是具有create session的,但是当用user3连接的时候,就报缺少create session 权限错误,不知道怎么搞的。
我试了很多次,查看role的权限也是具有create session的,但是当用user3连接的时候,就报缺少create session 权限错误,不知道怎么搞的。用命令再把role2授权给user3 很多次了,每次都是授予成功,但是user3 连接不上
grant create session to user3 这样就可以连接上
不过你创建角色和用户的时候用数字当密码能通过吗?需要加双引号吧
create role role2
identified by "888888";
加了引号,但还是连接不上user3
将角色授予给user3时,就不能连接。
这才是最头疼的