Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Why must we GRANT SELECT directly?

896971Jun 22 2018 — edited Jun 25 2018

To create a view that pulls data from another user's table, a user must have SELECT privileges on that table. OK, I understand that. However, the SELECT privileges must be given directly and not through a ROLE. Why? Assuming a typical scenario where several users accessed data from one main schema ("DataSchemaX"), they could potentially create a view on any of DataSchemaX's tables. So I would need to manually GRANT SELECT on every individual table for every individual user, which defeats the purpose of roles. So, what is the reason for this?

A relevant URL:

https://docs.oracle.com/cd/B28359_01/server.111/b28286/statements_8004.htm 

"The owner of the schema containing the view must have the privileges necessary to either select, insert, update, or delete rows from all the tables or views on which the view is based. The owner must be granted these privileges directly, rather than through a role."

This post has been answered by JohnWatson2 on Jun 23 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 23 2018
Added on Jun 22 2018
19 comments
903 views