开发者

Oracle table SELECT rights issue

My application has few tables on Oracle where user XYZ is the schema owner. Tables has been created using XYZ. And I would like to have ABCUSER to have CRUD rights on these tables. I have given the access via GRANT ALL ON TABLEABC to ABCUSER and grant is succeeded.

But when this user(ABCUSER) tries to query the DB (select * from TABLEABC) it doesn't seem to work. I get error message

ORA-00942: table or view does not exist
00942. 00000 -  "table or view does not exist"
*Cause:    
*Action:
Error at Line: 1 Column: 14

Could 开发者_如何学Pythonyou please tell what am I missing ?


User ABCUSER has privileges on the table but doesn't own it. So you need to include the schema in the query:

select * from XYZ.TABLEABC
/

If you don't want to hardcode the schema name in your programs your user can build a synonym:

create synonym TABLEABC for XYZ.TABLEABC
/

Then the original query will work for ABCUSER.

Note that ABCUSER will require the CREATE SYNONYM privilege.


As APC says, you are missing a SYNONYM.

You might want either a PRIVATE or PUBLIC synonym depending upon who you want to be able to view the table.

A good description of the various types and their uses is here: http://www.orafaq.com/wiki/Synonym

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜