Oracle创建视图的一个问题

时间:2024-11-20 23:03:49

问题:

  在用户user1中创建视图,查询内容包含user2下的表数据, 创建视图的时候提示“权限不足”。执行如下语句:

--为USER1授权
GRANT CREATE ANY TABLE TO USER1;
GRANT SELECT ANY TABLE TO USER1;
GRANT COMMENT ANY TABLE TO USER1;
GRANT LOCK ANY TABLE TO USER1;
GRANT SELECT ANY DICTIONARY TO USER1;
--为USER2授权
GRANT CREATE ANY TABLE TO USER2;
GRANT SELECT ANY TABLE TO USER2;
GRANT COMMENT ANY TABLE TO USER2;
GRANT LOCK ANY TABLE TO USER2;
GRANT SELECT ANY DICTIONARY TO USER2;