DBA_USER: create role test_2
DBA_user: grant create session, create any table, create any procedure to test_2;
grant succeeded.....
grant test_2 to new_user
现在是new_user:
create table items (item_number number(3) primary key,
item_name varchar2(40),
item_desp varchar2(20),
item_qty number(3));
Error: you have insufficient privilege
答案 0 :(得分:0)
确切的Oracle错误代码会有所帮助,但首先猜测new_user
对SYSTEM
(或其他tablespace
)没有特权。一般不建议使用SYSTEM表空间,所以让我们先创建表空间。
为用户创建单独的表空间:
create tablespace tbs_for_new_user
datafile 'tbs_nu.dbf' size 50m;
然后将新创建的表空间分配给用户作为默认值
alter user "NEW_USER"
default tablespace "TBS_FOR_NEW_USER"
temporaty tablespace "TEMP"
account unlock; // if you did not unlock new_user account yet
alter user "NEW_USER" quota 50000m on TBS_FOR_NEW_USER;
alter user "NEW_USER" DEFAULT ROLE "TEST_2";
然后尝试创建表。