create view遭遇ORA-03031

    使用普通用户创建如下视图
> create view mystats
> as
> select a.name, b.value
> from v$statname a, v$mystat b
> where a.statistic# = b.statistic#;
报错ORA-01031: insufficient privileges
用户已经具备CREATE VIEW,SELECT ANY TABLE权限。

分析需要对对象直接授权。
SQL> grant select on v$statname to bobo;
grant select on v$statname to bobo
                *
ERROR at line 1:
ORA-02030: can only select from fixed tables/views

--v$statname是同义词,不能直接授权,对视图进行授权
SQL> grant select on v_$statname to bobo;

Grant succeeded.

SQL> grant select on v_$mystat to bobo;

Grant succeeded.

再次创建视图,成功。

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/10522540/viewspace-625428/,如需转载,请注明出处,否则将追究法律责任。

转载于:http://blog.itpub.net/10522540/viewspace-625428/

你可能感兴趣的:(create view遭遇ORA-03031)