ORA-00942:表或视图不存在错误给出了即使我授予用户选择权限 [英] ORA-00942: table or view does not exist error is given even though I granted Select privilege to the user

查看:235
本文介绍了ORA-00942:表或视图不存在错误给出了即使我授予用户选择权限的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对于我的Oracle数据库,我创建了一个用户.我希望该用户只能访问3个表.所以我写了这些查询:

For my Oracle database I created a user. I want that user to have access to only 3 tables. So I wrote those queries:

grant select on table1 to newuser;
grant select on table2 to newuser;
grant select on table3 to newuser;

我是从控制台获得的,这可以确保我给予了资助.

And I got this from the console, which ensures that I gave the grant.

GRANT succeeded

但是,当我与此用户连接到数据库并编写以下查询时,会出现ORA-00942错误.

However when I connect to database with this user and write the following query, I get ORA-00942 error.

Select * from table1;

我认为我需要为特权和角色编写其他查询(我已经添加了CONNECT角色).可能是什么?

I think I need to write additional queries for privileges and roles(I already added CONNECT role). What might it be?

推荐答案

通过指定表所有者来运行查询.

Run the query by specifying table owner.

Select * from tableowner.table1;

如果这不起作用,则说明您尚未授予对正确表的访问权限,或者您以错误的用户身份登录.

If this doesn't work then either you have not granted access on correct table or you are logged in with wrong user.

记住相同的表名可以存在于多个模式中.

remember same table name can exist in multiple schemas.

这篇关于ORA-00942:表或视图不存在错误给出了即使我授予用户选择权限的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆