记录一次ORA-01031权限不足的报错,用户具备dba权限

接触一次很奇怪的报错,用户在具备dba权限的情况下,创建视图出现ora-01031 权限不足的报错,情景如下:
1,创建测试用户
create user test identified by test;
2,赋权
grant resource,connect,dba to test;
3,登录用户查看权限
conn test/test

SQL> select * from user_sys_privs;
USERNAME                       PRIVILEGE                                ADM
------------------------------ ---------------------------------------- ---
TEST                           UNLIMITED TABLESPACE                     NO 
SQL> select * from user_role_privs;

USERNAME                       GRANTED_ROLE                   ADM DEF OS_
------------------------------ ------------------------------ --- --- ---
TEST                           CONNECT                        NO  YES NO
TEST                           DBA                            NO  YES NO
TEST                           RESOURCE                       NO  YES NO

4,创建视图报错

SQL> create view test_v as select * from dba_objects;
create view test_v as select * from dba_objects
                                    *
ERROR at line 1:
ORA-01031: insufficient privileges

5,赋权后创建成功


SQL> conn / as sysdba
Connected.
SQL> grant select on dba_objects to test;

Grant succeeded.

SQL> conn test/test
Connected.
SQL> create view test_v as select * from dba_objects;

View created.

问题出现的原因还需进一步查找

你可能感兴趣的:(Oracle)