2017-07-15 82 views
0
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:授予角色new_user不12C

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 
+1

你有特別的Oracle錯誤代碼嗎?哪個操作系統? – fg78nc

+0

窗口服務器2008,安裝了12 c它 –

+0

請參閱下面的建議 – fg78nc

回答

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"; 

然後嘗試創建表。

+0

這是真的有用。 –